mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 21:41:35 +00:00
Timeline view with preview and object hilighting.
Embedded timeline view instead of new window. code formatting
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.gui.timeline;
|
||||
|
||||
import com.jpexs.decompiler.flash.gui.AppFrame;
|
||||
import com.jpexs.decompiler.flash.gui.ImagePanel;
|
||||
import com.jpexs.decompiler.flash.gui.View;
|
||||
import com.jpexs.decompiler.flash.timeline.Timelined;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Image;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSplitPane;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class TimelineViewPanel extends JPanel {
|
||||
|
||||
public TimelinePanel timeline;
|
||||
public ImagePanel previewPanel;
|
||||
|
||||
public TimelineViewPanel() {
|
||||
|
||||
}
|
||||
|
||||
public void setTimelined(Timelined timelined) {
|
||||
removeAll();
|
||||
if (timelined == null) {
|
||||
revalidate();
|
||||
return;
|
||||
}
|
||||
setLayout(new BorderLayout());
|
||||
timeline = new TimelinePanel();
|
||||
timeline.setTimelined(timelined);
|
||||
add(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, timeline, previewPanel = new ImagePanel()));
|
||||
|
||||
previewPanel.setTimelined(timelined, timelined.getTimeline().swf, 0);
|
||||
//previewPanel.setPreferredSize(new Dimension(400,300));
|
||||
previewPanel.pause();
|
||||
previewPanel.gotoFrame(0);
|
||||
timeline.addFrameSelectionListener(new FrameSelectionListener() {
|
||||
|
||||
@Override
|
||||
public void frameSelected(int frame, int depth) {
|
||||
previewPanel.selectDepth(depth);
|
||||
previewPanel.pause();
|
||||
previewPanel.gotoFrame(frame);
|
||||
}
|
||||
});
|
||||
revalidate();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user