mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 08:30:44 +00:00
Replace movie GUI stub
This commit is contained in:
@@ -3974,6 +3974,9 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
if (ti0 instanceof ShapeTag) {
|
||||
file = showImportFileChooser("filter.images|*.jpg;*.jpeg;*.gif;*.png;*.bmp;*.svg", true);
|
||||
}
|
||||
if (ti0 instanceof DefineVideoStreamTag) {
|
||||
file = showImportFileChooser("filter.movies|*.flv", false);
|
||||
}
|
||||
if (ti0 instanceof DefineBinaryDataTag) {
|
||||
file = showImportFileChooser("", false);
|
||||
}
|
||||
@@ -4086,6 +4089,10 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
refreshTree(ut.getSwf());
|
||||
reload(true);
|
||||
}
|
||||
|
||||
if (item instanceof DefineVideoStreamTag) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void replaceNoFillButtonActionPerformed(TreeItem item) {
|
||||
@@ -4705,7 +4712,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
previewPanel.showUnknownPanel(unknownTag);
|
||||
} else if (treeItem instanceof ImageTag) {
|
||||
ImageTag imageTag = (ImageTag) treeItem;
|
||||
previewPanel.setImageReplaceButtonVisible(!((Tag) imageTag).isReadOnly() && imageTag.importSupported(), imageTag instanceof DefineBitsJPEG3Tag || imageTag instanceof DefineBitsJPEG4Tag, false, false);
|
||||
previewPanel.setImageReplaceButtonVisible(!((Tag) imageTag).isReadOnly() && imageTag.importSupported(), imageTag instanceof DefineBitsJPEG3Tag || imageTag instanceof DefineBitsJPEG4Tag, false, false, false);
|
||||
SWF imageSWF = makeTimelinedImage(imageTag);
|
||||
previewPanel.showImagePanel(imageSWF, imageSWF, 0, false, true, true, true, true, false, false);
|
||||
|
||||
@@ -4721,7 +4728,10 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
|
||||
previewPanel.setParametersPanelVisible(false);
|
||||
if (treeItem instanceof ShapeTag) {
|
||||
previewPanel.setImageReplaceButtonVisible(false, false, !((Tag) treeItem).isReadOnly(), false);
|
||||
previewPanel.setImageReplaceButtonVisible(false, false, !((Tag) treeItem).isReadOnly(), false, false);
|
||||
}
|
||||
if (treeItem instanceof DefineVideoStreamTag) {
|
||||
previewPanel.setImageReplaceButtonVisible(false, false, false, false, !((Tag) treeItem).isReadOnly());
|
||||
}
|
||||
previewPanel.showImagePanel(timelined, tag.getSwf(), -1, true, Configuration.autoPlayPreviews.get(), !Configuration.animateSubsprites.get(), treeItem instanceof ShapeTag, !Configuration.playFrameSounds.get(), (treeItem instanceof DefineSpriteTag) || (treeItem instanceof ButtonTag), (treeItem instanceof DefineSpriteTag) || (treeItem instanceof ButtonTag));
|
||||
} else if (treeItem instanceof Frame && internalViewer) {
|
||||
@@ -4738,7 +4748,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
previewPanel.showImagePanel(timelinedContainer, swf, frame, true, Configuration.autoPlayPreviews.get(), !Configuration.animateSubsprites.get(), false, !Configuration.playFrameSounds.get(), true, false);
|
||||
} else if ((treeItem instanceof SoundTag)) { //&& isInternalFlashViewerSelected() && (Arrays.asList("mp3", "wav").contains(((SoundTag) tagObj).getExportFormat())))) {
|
||||
previewPanel.showImagePanel(new SerializableImage(View.loadImage("sound32")));
|
||||
previewPanel.setImageReplaceButtonVisible(false, false, false, !((Tag) treeItem).isReadOnly() && (treeItem instanceof DefineSoundTag));
|
||||
previewPanel.setImageReplaceButtonVisible(false, false, false, !((Tag) treeItem).isReadOnly() && (treeItem instanceof DefineSoundTag), false);
|
||||
try {
|
||||
SoundTagPlayer soundThread = new SoundTagPlayer(null, (SoundTag) treeItem, Configuration.loopMedia.get() ? Integer.MAX_VALUE : 1, true);
|
||||
if (!Configuration.autoPlaySounds.get()) {
|
||||
@@ -4869,7 +4879,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
previewPanel.clear();
|
||||
stopFlashPlayer();
|
||||
|
||||
previewPanel.setImageReplaceButtonVisible(false, false, false, false);
|
||||
previewPanel.setImageReplaceButtonVisible(false, false, false, false, false);
|
||||
|
||||
boolean internalViewer = !isAdobeFlashPlayerEnabled();
|
||||
|
||||
|
||||
@@ -167,6 +167,8 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
private JButton replaceImageButton;
|
||||
|
||||
private JButton replaceImageAlphaButton;
|
||||
|
||||
private JButton replaceMovieButton;
|
||||
|
||||
private JButton prevFontsButton;
|
||||
|
||||
@@ -356,6 +358,16 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
replaceImageAlphaButton.setMargin(new Insets(3, 3, 3, 10));
|
||||
replaceImageAlphaButton.addActionListener(mainPanel::replaceAlphaButtonActionPerformed);
|
||||
replaceImageAlphaButton.setVisible(false);
|
||||
|
||||
replaceMovieButton = new JButton(mainPanel.translate("button.replace"), View.getIcon("replacemovie16"));
|
||||
replaceMovieButton.setMargin(new Insets(3, 3, 3, 10));
|
||||
replaceMovieButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
mainPanel.replaceButtonActionPerformed(mainPanel.getCurrentTree().getSelected());
|
||||
}
|
||||
});
|
||||
replaceMovieButton.setVisible(false);
|
||||
|
||||
prevFontsButton = new JButton(mainPanel.translate("button.prev"), View.getIcon("prev16"));
|
||||
prevFontsButton.setMargin(new Insets(3, 3, 3, 10));
|
||||
@@ -373,6 +385,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
imageButtonsPanel.add(replaceShapeUpdateBoundsButton);
|
||||
imageButtonsPanel.add(replaceImageButton);
|
||||
imageButtonsPanel.add(replaceImageAlphaButton);
|
||||
imageButtonsPanel.add(replaceMovieButton);
|
||||
imageButtonsPanel.add(prevFontsButton);
|
||||
imageButtonsPanel.add(nextFontsButton);
|
||||
return imageButtonsPanel;
|
||||
@@ -1112,18 +1125,20 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
placeTransformButton.setVisible(!tag.isReadOnly() && !readOnly);
|
||||
}
|
||||
|
||||
public void setImageReplaceButtonVisible(boolean showImage, boolean showAlpha, boolean showShape, boolean showSound) {
|
||||
public void setImageReplaceButtonVisible(boolean showImage, boolean showAlpha, boolean showShape, boolean showSound, boolean showMovie) {
|
||||
if (readOnly) {
|
||||
showImage = false;
|
||||
showAlpha = false;
|
||||
showShape = false;
|
||||
showSound = false;
|
||||
showMovie = false;
|
||||
}
|
||||
replaceImageButton.setVisible(showImage);
|
||||
replaceImageAlphaButton.setVisible(showAlpha);
|
||||
replaceShapeButton.setVisible(showShape);
|
||||
replaceShapeUpdateBoundsButton.setVisible(showShape);
|
||||
replaceSoundButton.setVisible(showSound);
|
||||
replaceMovieButton.setVisible(showMovie);
|
||||
prevFontsButton.setVisible(false);
|
||||
nextFontsButton.setVisible(false);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
@@ -1086,4 +1086,6 @@ status.editing.autosave = You are in the EDIT mode. Make changes, then press Sav
|
||||
|
||||
error.sound.rate = The input sound has unsupported sampling rate: %saplingRate%.\r\n\
|
||||
You should convert it to one of supported rates (%supportedRates%)\r\n\
|
||||
with some sound editor before importing.
|
||||
with some sound editor before importing.
|
||||
|
||||
filter.movies = Supported movie formats (%extensions%)
|
||||
@@ -47,6 +47,7 @@ import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineButton2Tag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineSoundTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag;
|
||||
import com.jpexs.decompiler.flash.tags.DoABC2Tag;
|
||||
import com.jpexs.decompiler.flash.tags.DoActionTag;
|
||||
import com.jpexs.decompiler.flash.tags.DoInitActionTag;
|
||||
@@ -971,6 +972,10 @@ public class TagTreeContextMenu extends JPopupMenu {
|
||||
if (canReplace.test(it -> it instanceof UnknownTag)) {
|
||||
replaceMenuItem.setVisible(true);
|
||||
}
|
||||
|
||||
if (canReplace.test(it -> it instanceof DefineVideoStreamTag)) {
|
||||
replaceMenuItem.setVisible(true);
|
||||
}
|
||||
|
||||
if (singleSelect) {
|
||||
final TreeItem firstItem = items.get(0);
|
||||
|
||||
Reference in New Issue
Block a user