diff --git a/src/com/jpexs/decompiler/flash/gui/LinkLabel.java b/src/com/jpexs/decompiler/flash/gui/LinkLabel.java index 04bac5e7a..dde76d589 100644 --- a/src/com/jpexs/decompiler/flash/gui/LinkLabel.java +++ b/src/com/jpexs/decompiler/flash/gui/LinkLabel.java @@ -1,96 +1,85 @@ -/* - * 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 . - */ -package com.jpexs.decompiler.flash.gui; - -import java.awt.Cursor; -import java.awt.event.MouseEvent; -import java.io.IOException; -import java.net.URISyntaxException; -import javax.swing.JLabel; - -/** - * An extension of JLabel which looks like a link and responds appropriately - * when clicked. Note that this class will only work with Swing 1.1.1 and later. - * Note that because of the way this class is implemented, getText() will not - * return correct values, user getNormalText instead. - */ -public class LinkLabel extends JLabel { - - /** - * The normal text set by the user. - */ - private String text; - - /** - * Creates a new LinkLabel with the given text. - * - * @param text - */ - public LinkLabel(String text) { - super(text); - - setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - - enableEvents(MouseEvent.MOUSE_EVENT_MASK); - } - - /** - * Sets the text of the label. - * - * @param text - */ - @Override - public void setText(String text) { - super.setText("" + text + ""); - this.text = text; - } - - /** - * Returns the text set by the user. - * - * @return - */ - public String getNormalText() { - return text; - } - - /** - * Processes mouse events and responds to clicks. - * - * @param evt - */ - @Override - protected void processMouseEvent(MouseEvent evt) { - super.processMouseEvent(evt); - if (evt.getID() == MouseEvent.MOUSE_CLICKED) { - clicked(); - } - } - - protected void clicked() { - if (java.awt.Desktop.isDesktopSupported()) { - java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); - try { - java.net.URI uri = new java.net.URI(getNormalText()); - desktop.browse(uri); - } catch (URISyntaxException | IOException e) { - - System.err.println(e.getMessage()); - } - } - } -} +/* + * 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 . + */ +package com.jpexs.decompiler.flash.gui; + +import java.awt.Cursor; +import java.awt.event.MouseEvent; +import javax.swing.JLabel; + +/** + * An extension of JLabel which looks like a link and responds appropriately + * when clicked. Note that this class will only work with Swing 1.1.1 and later. + * Note that because of the way this class is implemented, getText() will not + * return correct values, user getNormalText instead. + */ +public class LinkLabel extends JLabel { + + /** + * The normal text set by the user. + */ + private String text; + + /** + * Creates a new LinkLabel with the given text. + * + * @param text + */ + public LinkLabel(String text) { + super(text); + + setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + + enableEvents(MouseEvent.MOUSE_EVENT_MASK); + } + + /** + * Sets the text of the label. + * + * @param text + */ + @Override + public void setText(String text) { + super.setText("" + text + ""); + this.text = text; + } + + /** + * Returns the text set by the user. + * + * @return + */ + public String getNormalText() { + return text; + } + + /** + * Processes mouse events and responds to clicks. + * + * @param evt + */ + @Override + protected void processMouseEvent(MouseEvent evt) { + super.processMouseEvent(evt); + if (evt.getID() == MouseEvent.MOUSE_CLICKED) { + clicked(); + } + } + + protected void clicked() { + View.navigateUrl(getNormalText()); + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java b/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java index f958d3260..0f6b7df53 100644 --- a/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/LoadFromCacheFrame.java @@ -148,7 +148,7 @@ public class LoadFromCacheFrame extends AppFrame implements ActionListener { openButton.setEnabled(false); saveButton.setEnabled(false); - java.util.List images = new ArrayList<>(); + List images = new ArrayList<>(); images.add(View.loadImage("loadcache16")); images.add(View.loadImage("loadcache32")); setIconImages(images); diff --git a/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java b/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java index 33cf7c293..bf1a4f4ae 100644 --- a/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/LoadFromMemoryFrame.java @@ -388,7 +388,7 @@ public class LoadFromMemoryFrame extends AppFrame implements ActionListener { cnt.add(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel), BorderLayout.CENTER); View.setWindowIcon(this); View.centerScreen(this); - java.util.List images = new ArrayList<>(); + List images = new ArrayList<>(); images.add(View.loadImage("loadmemory16")); images.add(View.loadImage("loadmemory32")); setIconImages(images); diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 0a2c6819c..4e912fccd 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -1147,7 +1147,7 @@ public class Main { if (!ver.changes.containsKey(changeType)) { ver.changes.put(changeType, new ArrayList()); } - java.util.List chlist = ver.changes.get(changeType); + List chlist = ver.changes.get(changeType); chlist.add(change); } } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java index 4cb2eed53..b2e0bf6e2 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassic.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.gui.player.FlashPlayerPanel; import java.awt.BorderLayout; +import java.awt.Container; import java.awt.Dimension; import java.awt.Window; import java.awt.event.ComponentAdapter; @@ -102,7 +103,7 @@ public final class MainFrameClassic extends AppFrame implements MainFrame { } }); - java.awt.Container cnt = getContentPane(); + Container cnt = getContentPane(); cnt.setLayout(new BorderLayout()); cnt.add(panel); diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java index 98ae89e6a..c58e83b28 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameClassicMenu.java @@ -28,7 +28,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.net.URISyntaxException; import java.util.List; import java.util.Timer; import java.util.TimerTask; @@ -543,27 +542,13 @@ public class MainFrameClassicMenu implements MainFrameMenu, ActionListener { break; case ACTION_HELP_US: String helpUsURL = ApplicationInfo.PROJECT_PAGE + "/help_us.html"; - if (java.awt.Desktop.isDesktopSupported()) { - java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); - try { - java.net.URI uri = new java.net.URI(helpUsURL); - desktop.browse(uri); - } catch (URISyntaxException | IOException ex) { - } - } else { + if (!View.navigateUrl(helpUsURL)) { View.showMessageDialog(null, translate("message.helpus").replace("%url%", helpUsURL)); } break; case ACTION_HOMEPAGE: String homePageURL = ApplicationInfo.PROJECT_PAGE; - if (java.awt.Desktop.isDesktopSupported()) { - java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); - try { - java.net.URI uri = new java.net.URI(homePageURL); - desktop.browse(uri); - } catch (URISyntaxException | IOException ex) { - } - } else { + if (!View.navigateUrl(homePageURL)) { View.showMessageDialog(null, translate("message.homepage").replace("%url%", homePageURL)); } break; diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java index 5f7a5d08f..df226710a 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbon.java @@ -124,8 +124,8 @@ public final class MainFrameRibbon extends AppRibbonFrame implements MainFrame { ret.add((JRibbonApplicationMenuButton) comp); return; } - if (comp instanceof java.awt.Container) { - java.awt.Container cont = (java.awt.Container) comp; + if (comp instanceof Container) { + Container cont = (Container) comp; for (int i = 0; i < cont.getComponentCount(); i++) { getApplicationMenuButtons(cont.getComponent(i), ret); } @@ -135,81 +135,6 @@ public final class MainFrameRibbon extends AppRibbonFrame implements MainFrame { @Override public void setVisible(boolean b) { super.setVisible(b); - - /* final MainFrameRibbon t = this; - - //TODO: Handle this better. This is awful :-( - new Timer().schedule(new TimerTask() { - @Override - public void run() { - List mbuttons = new ArrayList<>(); - getApplicationMenuButtons(t, mbuttons); - if (mbuttons.size() < 2) { - //return, task will run again - return; - } - - for (final JRibbonApplicationMenuButton mbutton : mbuttons) { - mbutton.setIcon(View.getResizableIcon("buttonicon_256")); - mbutton.setDisplayState(new CommandButtonDisplayState( - "My Ribbon Application Menu Button", mbutton.getSize().width) { - @Override - public CommandButtonLayoutManager createLayoutManager( - AbstractCommandButton commandButton) { - return new CommandButtonLayoutManager() { - @Override - public int getPreferredIconSize() { - return mbutton.getSize().width; - } - - @Override - public CommandButtonLayoutManager.CommandButtonLayoutInfo getLayoutInfo( - AbstractCommandButton commandButton, Graphics g) { - CommandButtonLayoutManager.CommandButtonLayoutInfo result = new CommandButtonLayoutManager.CommandButtonLayoutInfo(); - result.actionClickArea = new Rectangle(0, 0, 0, 0); - result.popupClickArea = new Rectangle(0, 0, commandButton - .getWidth(), commandButton.getHeight()); - result.popupActionRect = new Rectangle(0, 0, 0, 0); - ResizableIcon icon = commandButton.getIcon(); - icon.setDimension(new Dimension(commandButton.getWidth(), commandButton.getHeight())); - result.iconRect = new Rectangle( - 0, - 0, - commandButton.getWidth(), commandButton.getHeight()); - result.isTextInActionArea = false; - return result; - } - - @Override - public Dimension getPreferredSize( - AbstractCommandButton commandButton) { - return new Dimension(40, 40); - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - } - - @Override - public Point getKeyTipAnchorCenterPoint( - AbstractCommandButton commandButton) { - // dead center - return new Point(commandButton.getWidth() / 2, - commandButton.getHeight() / 2); - } - }; - } - }); - - MyRibbonApplicationMenuButtonUI mui = (MyRibbonApplicationMenuButtonUI) mbutton.getUI(); - mui.setHoverIcon(View.getResizableIcon("buttonicon_hover_256")); - mui.setNormalIcon(View.getResizableIcon("buttonicon_256")); - mui.setClickIcon(View.getResizableIcon("buttonicon_down_256")); - mbutton.repaint(); - } - cancel(); //cancel task so it does not run again - } - }, 1, 50);*/ panel.setVisible(b); } diff --git a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java index 63720776e..b65e2223f 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java +++ b/src/com/jpexs/decompiler/flash/gui/MainFrameRibbonMenu.java @@ -36,7 +36,6 @@ import java.awt.event.ActionListener; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import java.util.Timer; @@ -292,7 +291,7 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener { } private List getResizePolicies(JRibbonBand ribbonBand) { - List resizePolicies = new ArrayList<>(); + List resizePolicies = new ArrayList<>(); resizePolicies.add(new CoreRibbonResizePolicies.Mirror(ribbonBand.getControlPanel())); resizePolicies.add(new IconRibbonBandResizePolicy(ribbonBand.getControlPanel())); return resizePolicies; @@ -844,27 +843,13 @@ public class MainFrameRibbonMenu implements MainFrameMenu, ActionListener { break; case ACTION_HELP_US: String helpUsURL = ApplicationInfo.PROJECT_PAGE + "/help_us.html"; - if (java.awt.Desktop.isDesktopSupported()) { - java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); - try { - java.net.URI uri = new java.net.URI(helpUsURL); - desktop.browse(uri); - } catch (URISyntaxException | IOException ex) { - } - } else { + if (!View.navigateUrl(helpUsURL)) { View.showMessageDialog(null, translate("message.helpus").replace("%url%", helpUsURL)); } break; case ACTION_HOMEPAGE: String homePageURL = ApplicationInfo.PROJECT_PAGE; - if (java.awt.Desktop.isDesktopSupported()) { - java.awt.Desktop desktop = java.awt.Desktop.getDesktop(); - try { - java.net.URI uri = new java.net.URI(homePageURL); - desktop.browse(uri); - } catch (URISyntaxException | IOException ex) { - } - } else { + if (!View.navigateUrl(homePageURL)) { View.showMessageDialog(null, translate("message.homepage").replace("%url%", homePageURL)); } break; diff --git a/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java b/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java index 51ee629d3..36b4e8b5c 100644 --- a/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/NewVersionDialog.java @@ -1,171 +1,158 @@ -/* - * 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 . - */ -package com.jpexs.decompiler.flash.gui; - -import com.jpexs.decompiler.flash.ApplicationInfo; -import com.jpexs.decompiler.flash.Version; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.IOException; -import java.net.URISyntaxException; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.BoxLayout; -import javax.swing.JButton; -import javax.swing.JEditorPane; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.SwingConstants; -import javax.swing.UIManager; - -/** - * - * @author JPEXS - */ -public class NewVersionDialog extends AppDialog implements ActionListener { - - static final String ACTION_OK = "OK"; - static final String ACTION_CANCEL = "CANCEL"; - - Version latestVersion; - - public NewVersionDialog(List versions) { - setSize(new Dimension(500, 300)); - Container cnt = getContentPane(); - cnt.setLayout(new BoxLayout(cnt, BoxLayout.PAGE_AXIS)); - JEditorPane changesText = new JEditorPane(); - changesText.setEditable(false); - changesText.setFont(UIManager.getFont("TextField.font")); - String changesStr = ""; - SimpleDateFormat serverFormatter = new SimpleDateFormat("MM/dd/yyyy"); - DateFormat formatter; - String customFormat = translate("customDateFormat"); - if (customFormat.equals("default")) { - formatter = DateFormat.getDateInstance(); - } else { - formatter = new SimpleDateFormat(customFormat); - } - boolean first = true; - for (Version v : versions) { - if (!first) { - changesStr += "
"; - } - first = false; - changesStr += "" + translate("version") + " " + v.versionName + (v.nightly ? " nightly " + v.revision : "") + "
"; - String releaseDate = v.releaseDate; - try { - Date date = serverFormatter.parse(releaseDate); - releaseDate = formatter.format(date); - } catch (ParseException ex) { - Logger.getLogger(NewVersionDialog.class.getName()).log(Level.SEVERE, null, ex); - } - changesStr += translate("releasedate") + " " + releaseDate; - if (!v.changes.isEmpty()) { - changesStr += "
"; - changesStr += "
";
-                for (String type : v.changes.keySet()) {
-                    changesStr += type + ":" + "
"; - for (String ch : v.changes.get(type)) { - changesStr += " - " + ch + "
"; - } - } - changesStr += "
"; - } - } - latestVersion = null; - if (!versions.isEmpty()) { - latestVersion = versions.get(0); - } - changesText.setContentType("text/html"); - changesText.setText("" + changesStr + ""); - JLabel newAvailableLabel = new JLabel("
" + translate("newversionavailable") + " " + latestVersion.appName + " " + translate("version") + " " + latestVersion.versionName + (latestVersion.nightly ? " " + latestVersion.revision : "") + "
", SwingConstants.CENTER); - newAvailableLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); - cnt.add(newAvailableLabel); - - JLabel changeslogLabel = new JLabel("" + translate("changeslog") + ""); - changeslogLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); - cnt.add(changeslogLabel); - - JScrollPane span = new JScrollPane(changesText); - span.setAlignmentX(JLabel.CENTER_ALIGNMENT); - cnt.add(span); - JPanel buttonsPanel = new JPanel(new FlowLayout()); - JButton buttonOk = new JButton(translate("button.ok")); - buttonOk.setActionCommand(ACTION_OK); - buttonOk.addActionListener(this); - - JButton buttonCancel = new JButton(translate("button.cancel")); - buttonCancel.setActionCommand(ACTION_CANCEL); - buttonCancel.addActionListener(this); - - buttonsPanel.add(buttonOk); - buttonsPanel.add(buttonCancel); - buttonsPanel.setAlignmentX(JLabel.CENTER_ALIGNMENT); - - JLabel downloadNowLabel = new JLabel("
" + translate("downloadnow") + "
", SwingConstants.CENTER); - downloadNowLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); - cnt.add(downloadNowLabel); - cnt.add(buttonsPanel); - - setResizable(false); - setTitle(translate("dialog.title")); - this.getRootPane().setDefaultButton(buttonOk); - View.centerScreen(this); - setModalityType(ModalityType.APPLICATION_MODAL); - changesText.setCaretPosition(0); - View.setWindowIcon(this); - } - - @Override - public void actionPerformed(ActionEvent e) { - if (e.getActionCommand() == ACTION_OK) { - java.awt.Desktop desktop = null; - if (java.awt.Desktop.isDesktopSupported()) { - desktop = java.awt.Desktop.getDesktop(); - if (desktop.isSupported(java.awt.Desktop.Action.BROWSE)) { - try { - if (latestVersion.updateLink != null) { - java.net.URI uri = new java.net.URI(latestVersion.updateLink); - desktop.browse(uri); - } else { - java.net.URI uri = new java.net.URI(ApplicationInfo.updatePage); - desktop.browse(uri); - } - Main.exit(); - } catch (URISyntaxException | IOException ex) { - } - } else { - desktop = null; - } - } - if (desktop == null) { - View.showMessageDialog(null, translate("newvermessage").replace("%oldAppName%", ApplicationInfo.SHORT_APPLICATION_NAME).replace("%newAppName%", latestVersion.appName).replace("%projectPage%", ApplicationInfo.PROJECT_PAGE), translate("newversion"), JOptionPane.INFORMATION_MESSAGE); - } - } - setVisible(false); - } -} +/* + * 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 . + */ +package com.jpexs.decompiler.flash.gui; + +import com.jpexs.decompiler.flash.ApplicationInfo; +import com.jpexs.decompiler.flash.Version; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingConstants; +import javax.swing.UIManager; + +/** + * + * @author JPEXS + */ +public class NewVersionDialog extends AppDialog implements ActionListener { + + static final String ACTION_OK = "OK"; + static final String ACTION_CANCEL = "CANCEL"; + + Version latestVersion; + + public NewVersionDialog(List versions) { + setSize(new Dimension(500, 300)); + Container cnt = getContentPane(); + cnt.setLayout(new BoxLayout(cnt, BoxLayout.PAGE_AXIS)); + JEditorPane changesText = new JEditorPane(); + changesText.setEditable(false); + changesText.setFont(UIManager.getFont("TextField.font")); + String changesStr = ""; + SimpleDateFormat serverFormatter = new SimpleDateFormat("MM/dd/yyyy"); + DateFormat formatter; + String customFormat = translate("customDateFormat"); + if (customFormat.equals("default")) { + formatter = DateFormat.getDateInstance(); + } else { + formatter = new SimpleDateFormat(customFormat); + } + boolean first = true; + for (Version v : versions) { + if (!first) { + changesStr += "
"; + } + first = false; + changesStr += "" + translate("version") + " " + v.versionName + (v.nightly ? " nightly " + v.revision : "") + "
"; + String releaseDate = v.releaseDate; + try { + Date date = serverFormatter.parse(releaseDate); + releaseDate = formatter.format(date); + } catch (ParseException ex) { + Logger.getLogger(NewVersionDialog.class.getName()).log(Level.SEVERE, null, ex); + } + changesStr += translate("releasedate") + " " + releaseDate; + if (!v.changes.isEmpty()) { + changesStr += "
"; + changesStr += "
";
+                for (String type : v.changes.keySet()) {
+                    changesStr += type + ":" + "
"; + for (String ch : v.changes.get(type)) { + changesStr += " - " + ch + "
"; + } + } + changesStr += "
"; + } + } + latestVersion = null; + if (!versions.isEmpty()) { + latestVersion = versions.get(0); + } + changesText.setContentType("text/html"); + changesText.setText("" + changesStr + ""); + JLabel newAvailableLabel = new JLabel("
" + translate("newversionavailable") + " " + latestVersion.appName + " " + translate("version") + " " + latestVersion.versionName + (latestVersion.nightly ? " " + latestVersion.revision : "") + "
", SwingConstants.CENTER); + newAvailableLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); + cnt.add(newAvailableLabel); + + JLabel changeslogLabel = new JLabel("" + translate("changeslog") + ""); + changeslogLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); + cnt.add(changeslogLabel); + + JScrollPane span = new JScrollPane(changesText); + span.setAlignmentX(JLabel.CENTER_ALIGNMENT); + cnt.add(span); + JPanel buttonsPanel = new JPanel(new FlowLayout()); + JButton buttonOk = new JButton(translate("button.ok")); + buttonOk.setActionCommand(ACTION_OK); + buttonOk.addActionListener(this); + + JButton buttonCancel = new JButton(translate("button.cancel")); + buttonCancel.setActionCommand(ACTION_CANCEL); + buttonCancel.addActionListener(this); + + buttonsPanel.add(buttonOk); + buttonsPanel.add(buttonCancel); + buttonsPanel.setAlignmentX(JLabel.CENTER_ALIGNMENT); + + JLabel downloadNowLabel = new JLabel("
" + translate("downloadnow") + "
", SwingConstants.CENTER); + downloadNowLabel.setAlignmentX(JLabel.CENTER_ALIGNMENT); + cnt.add(downloadNowLabel); + cnt.add(buttonsPanel); + + setResizable(false); + setTitle(translate("dialog.title")); + this.getRootPane().setDefaultButton(buttonOk); + View.centerScreen(this); + setModalityType(ModalityType.APPLICATION_MODAL); + changesText.setCaretPosition(0); + View.setWindowIcon(this); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand() == ACTION_OK) { + String url; + if (latestVersion.updateLink != null) { + url = latestVersion.updateLink; + } else { + url = ApplicationInfo.updatePage; + } + if (View.navigateUrl(url)) { + Main.exit(); + } else { + View.showMessageDialog(null, translate("newvermessage").replace("%oldAppName%", ApplicationInfo.SHORT_APPLICATION_NAME).replace("%newAppName%", latestVersion.appName).replace("%projectPage%", ApplicationInfo.PROJECT_PAGE), translate("newversion"), JOptionPane.INFORMATION_MESSAGE); + } + } + setVisible(false); + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java b/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java index 22a76611b..e89cb1dd6 100644 --- a/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/QuickFindPanel.java @@ -23,6 +23,7 @@ import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.lang.ref.WeakReference; +import java.util.ResourceBundle; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import javax.swing.BorderFactory; @@ -80,7 +81,7 @@ public class QuickFindPanel extends JPanel implements ActionListener { setName("QuickFindDialog"); // NOI18N jLabel1.setLabelFor(findTextField); - java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("jsyntaxpane/Bundle"); // NOI18N + ResourceBundle bundle = ResourceBundle.getBundle("jsyntaxpane/Bundle"); // NOI18N jLabel1.setText(bundle.getString("QuickFindDialog.jLabel1.text")); // NOI18N pan1.add(jLabel1); diff --git a/src/com/jpexs/decompiler/flash/gui/SearchDialog.java b/src/com/jpexs/decompiler/flash/gui/SearchDialog.java index 092e68bc2..65a4b6822 100644 --- a/src/com/jpexs/decompiler/flash/gui/SearchDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/SearchDialog.java @@ -1,133 +1,134 @@ -/* - * 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 . - */ -package com.jpexs.decompiler.flash.gui; - -import java.awt.Container; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Image; -import java.awt.Window; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; -import javax.swing.BoxLayout; -import javax.swing.ButtonGroup; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JDialog; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JTextField; - -/** - * - * @author JPEXS - */ -public class SearchDialog extends AppDialog implements ActionListener { - - static final String ACTION_OK = "OK"; - static final String ACTION_CANCEL = "CANCEL"; - - public JTextField searchField = new MyTextField(); - public JCheckBox ignoreCaseCheckBox = new JCheckBox(translate("checkbox.ignorecase")); - public JCheckBox regexpCheckBox = new JCheckBox(translate("checkbox.regexp")); - public JRadioButton searchInASRadioButton = new JRadioButton(translate("checkbox.searchAS")); - public JRadioButton searchInTextsRadioButton = new JRadioButton(translate("checkbox.searchText")); - public boolean result = false; - - public SearchDialog(Window owner) { - super(owner); - setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); - Container cnt = getContentPane(); - setSize(400, 150); - cnt.setLayout(new BoxLayout(cnt, BoxLayout.PAGE_AXIS)); - JPanel panButtons = new JPanel(new FlowLayout()); - JButton okButton = new JButton(translate("button.ok")); - okButton.setActionCommand(ACTION_OK); - okButton.addActionListener(this); - JButton cancelButton = new JButton(translate("button.cancel")); - cancelButton.setActionCommand(ACTION_CANCEL); - cancelButton.addActionListener(this); - panButtons.add(okButton); - panButtons.add(cancelButton); - JPanel panField = new JPanel(new FlowLayout()); - searchField.setPreferredSize(new Dimension(250, searchField.getPreferredSize().height)); - panField.add(new JLabel(translate("label.searchtext"))); - panField.add(searchField); - cnt.add(panField); - - JPanel checkPanel = new JPanel(new FlowLayout()); - checkPanel.add(ignoreCaseCheckBox); - checkPanel.add(regexpCheckBox); - cnt.add(checkPanel); - - ButtonGroup group = new ButtonGroup(); - group.add(searchInASRadioButton); - group.add(searchInTextsRadioButton); - - JPanel rbPanel = new JPanel(new FlowLayout()); - searchInASRadioButton.setSelected(true); - searchInTextsRadioButton.setSelected(false); - rbPanel.add(searchInASRadioButton); - rbPanel.add(searchInTextsRadioButton); - cnt.add(rbPanel); - - cnt.add(panButtons); - getRootPane().setDefaultButton(okButton); - View.centerScreen(this); - //View.setWindowIcon(this); - setIconImage(View.loadImage("search16")); - setTitle(translate("dialog.title")); - setModalityType(ModalityType.APPLICATION_MODAL); - pack(); - java.util.List images = new ArrayList<>(); - images.add(View.loadImage("search16")); - images.add(View.loadImage("search32")); - setIconImages(images); - } - - @Override - public void setVisible(boolean b) { - if (b) { - result = false; - searchField.requestFocusInWindow(); - } - super.setVisible(b); - } - - @Override - public void actionPerformed(ActionEvent e) { - if (e.getActionCommand() == ACTION_OK) { - if (regexpCheckBox.isSelected()) { - try { - Pattern pat = Pattern.compile(searchField.getText()); - } catch (PatternSyntaxException ex) { - View.showMessageDialog(null, translate("error.invalidregexp"), translate("error"), JOptionPane.ERROR_MESSAGE); - return; - } - } - result = true; - } else { - result = false; - } - setVisible(false); - } -} +/* + * 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 . + */ +package com.jpexs.decompiler.flash.gui; + +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Image; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; +import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JTextField; + +/** + * + * @author JPEXS + */ +public class SearchDialog extends AppDialog implements ActionListener { + + static final String ACTION_OK = "OK"; + static final String ACTION_CANCEL = "CANCEL"; + + public JTextField searchField = new MyTextField(); + public JCheckBox ignoreCaseCheckBox = new JCheckBox(translate("checkbox.ignorecase")); + public JCheckBox regexpCheckBox = new JCheckBox(translate("checkbox.regexp")); + public JRadioButton searchInASRadioButton = new JRadioButton(translate("checkbox.searchAS")); + public JRadioButton searchInTextsRadioButton = new JRadioButton(translate("checkbox.searchText")); + public boolean result = false; + + public SearchDialog(Window owner) { + super(owner); + setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); + Container cnt = getContentPane(); + setSize(400, 150); + cnt.setLayout(new BoxLayout(cnt, BoxLayout.PAGE_AXIS)); + JPanel panButtons = new JPanel(new FlowLayout()); + JButton okButton = new JButton(translate("button.ok")); + okButton.setActionCommand(ACTION_OK); + okButton.addActionListener(this); + JButton cancelButton = new JButton(translate("button.cancel")); + cancelButton.setActionCommand(ACTION_CANCEL); + cancelButton.addActionListener(this); + panButtons.add(okButton); + panButtons.add(cancelButton); + JPanel panField = new JPanel(new FlowLayout()); + searchField.setPreferredSize(new Dimension(250, searchField.getPreferredSize().height)); + panField.add(new JLabel(translate("label.searchtext"))); + panField.add(searchField); + cnt.add(panField); + + JPanel checkPanel = new JPanel(new FlowLayout()); + checkPanel.add(ignoreCaseCheckBox); + checkPanel.add(regexpCheckBox); + cnt.add(checkPanel); + + ButtonGroup group = new ButtonGroup(); + group.add(searchInASRadioButton); + group.add(searchInTextsRadioButton); + + JPanel rbPanel = new JPanel(new FlowLayout()); + searchInASRadioButton.setSelected(true); + searchInTextsRadioButton.setSelected(false); + rbPanel.add(searchInASRadioButton); + rbPanel.add(searchInTextsRadioButton); + cnt.add(rbPanel); + + cnt.add(panButtons); + getRootPane().setDefaultButton(okButton); + View.centerScreen(this); + //View.setWindowIcon(this); + setIconImage(View.loadImage("search16")); + setTitle(translate("dialog.title")); + setModalityType(ModalityType.APPLICATION_MODAL); + pack(); + List images = new ArrayList<>(); + images.add(View.loadImage("search16")); + images.add(View.loadImage("search32")); + setIconImages(images); + } + + @Override + public void setVisible(boolean b) { + if (b) { + result = false; + searchField.requestFocusInWindow(); + } + super.setVisible(b); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand() == ACTION_OK) { + if (regexpCheckBox.isSelected()) { + try { + Pattern pat = Pattern.compile(searchField.getText()); + } catch (PatternSyntaxException ex) { + View.showMessageDialog(null, translate("error.invalidregexp"), translate("error"), JOptionPane.ERROR_MESSAGE); + return; + } + } + result = true; + } else { + result = false; + } + setVisible(false); + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/View.java b/src/com/jpexs/decompiler/flash/gui/View.java index 3df20b3bf..52323a5d3 100644 --- a/src/com/jpexs/decompiler/flash/gui/View.java +++ b/src/com/jpexs/decompiler/flash/gui/View.java @@ -17,9 +17,11 @@ package com.jpexs.decompiler.flash.gui; import com.jpexs.decompiler.flash.configuration.ConfigurationItem; +import com.jpexs.helpers.Helper; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; +import java.awt.Desktop; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; @@ -35,6 +37,9 @@ import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; @@ -233,7 +238,7 @@ public class View { * @return loaded Image */ public static BufferedImage loadImage(String name) { - java.net.URL imageURL = View.class.getResource("/com/jpexs/decompiler/flash/gui/graphics/" + name + ".png"); + URL imageURL = View.class.getResource("/com/jpexs/decompiler/flash/gui/graphics/" + name + ".png"); try { return ImageIO.read(imageURL); } catch (IOException ex) { @@ -247,7 +252,7 @@ public class View { * @param f Frame to set icon in */ public static void setWindowIcon(Window f) { - java.util.List images = new ArrayList<>(); + List images = new ArrayList<>(); images.add(loadImage("icon16")); images.add(loadImage("icon32")); images.add(loadImage("icon48")); @@ -519,4 +524,22 @@ public class View { JMenuItem findUsagesMenu = new JMenuItem(a); pmenu.add(findUsagesMenu); } + + public static boolean navigateUrl(String url) { + if (Desktop.isDesktopSupported()) { + Desktop desktop = Desktop.getDesktop(); + if (desktop.isSupported(Desktop.Action.BROWSE)) { + try { + URI uri = new URI(url); + desktop.browse(uri); + return true; + } catch (URISyntaxException | IOException ex) { + Logger.getLogger(Helper.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + return false; + } } + diff --git a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index 6720ff4f7..eee52ffbc 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -85,7 +85,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; @@ -758,19 +757,7 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Se if (swc == null) { if (View.showConfirmDialog(this, AppStrings.translate("message.action.playerglobal.needed").replace("%adobehomepage%", adobePage), AppStrings.translate("message.action.playerglobal.title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.OK_OPTION) { - java.awt.Desktop desktop = null; - if (java.awt.Desktop.isDesktopSupported()) { - desktop = java.awt.Desktop.getDesktop(); - if (desktop.isSupported(java.awt.Desktop.Action.BROWSE)) { - try { - java.net.URI uri = new java.net.URI(adobePage); - desktop.browse(uri); - } catch (URISyntaxException | IOException ex) { - } - } else { - desktop = null; - } - } + View.navigateUrl(adobePage); int ret = 0; do { diff --git a/src/com/jpexs/decompiler/flash/gui/abc/IconListRenderer.java b/src/com/jpexs/decompiler/flash/gui/abc/IconListRenderer.java index 55ea4a62a..9e70a375b 100644 --- a/src/com/jpexs/decompiler/flash/gui/abc/IconListRenderer.java +++ b/src/com/jpexs/decompiler/flash/gui/abc/IconListRenderer.java @@ -1,72 +1,73 @@ -/* - * 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 . - */ -package com.jpexs.decompiler.flash.gui.abc; - -import com.jpexs.decompiler.flash.gui.View; -import java.awt.Component; -import javax.swing.DefaultListCellRenderer; -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JLabel; -import javax.swing.JList; - -public class IconListRenderer extends DefaultListCellRenderer { - - private final Icon constIcon; - private final Icon functionIcon; - private final Icon variableIcon; - - private Icon loadIcon(String path) { - ClassLoader cldr = this.getClass().getClassLoader(); - java.net.URL imageURL = cldr.getResource(path); - return new ImageIcon(imageURL); - } - - public IconListRenderer() { - constIcon = View.getIcon("constant"); - functionIcon = View.getIcon("function"); - variableIcon = View.getIcon("variable"); - } - - @Override - public Component getListCellRendererComponent( - JList list, Object value, int index, - boolean isSelected, boolean cellHasFocus) { - - // Get the renderer component from parent class - JLabel label - = (JLabel) super.getListCellRendererComponent(list, - value, index, isSelected, cellHasFocus); - - // Get icon to use for the list item value - TraitsListItem tli = (TraitsListItem) value; - - if (tli.getType() == TraitsListItem.Type.CONST) { - label.setIcon(constIcon); - } - if (tli.getType() == TraitsListItem.Type.VAR) { - label.setIcon(variableIcon); - } - if (tli.getType() == TraitsListItem.Type.METHOD) { - label.setIcon(functionIcon); - } - if (tli.getType() == TraitsListItem.Type.INITIALIZER) { - label.setIcon(functionIcon); - } - return label; - } -} +/* + * 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 . + */ +package com.jpexs.decompiler.flash.gui.abc; + +import com.jpexs.decompiler.flash.gui.View; +import java.awt.Component; +import java.net.URL; +import javax.swing.DefaultListCellRenderer; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JList; + +public class IconListRenderer extends DefaultListCellRenderer { + + private final Icon constIcon; + private final Icon functionIcon; + private final Icon variableIcon; + + private Icon loadIcon(String path) { + ClassLoader cldr = this.getClass().getClassLoader(); + URL imageURL = cldr.getResource(path); + return new ImageIcon(imageURL); + } + + public IconListRenderer() { + constIcon = View.getIcon("constant"); + functionIcon = View.getIcon("function"); + variableIcon = View.getIcon("variable"); + } + + @Override + public Component getListCellRendererComponent( + JList list, Object value, int index, + boolean isSelected, boolean cellHasFocus) { + + // Get the renderer component from parent class + JLabel label + = (JLabel) super.getListCellRendererComponent(list, + value, index, isSelected, cellHasFocus); + + // Get icon to use for the list item value + TraitsListItem tli = (TraitsListItem) value; + + if (tli.getType() == TraitsListItem.Type.CONST) { + label.setIcon(constIcon); + } + if (tli.getType() == TraitsListItem.Type.VAR) { + label.setIcon(variableIcon); + } + if (tli.getType() == TraitsListItem.Type.METHOD) { + label.setIcon(functionIcon); + } + if (tli.getType() == TraitsListItem.Type.INITIALIZER) { + label.setIcon(functionIcon); + } + return label; + } +} diff --git a/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java b/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java index 5d1305b17..a3439c8a0 100644 --- a/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/proxy/ProxyFrame.java @@ -43,6 +43,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Calendar; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.BoxLayout; @@ -182,7 +183,7 @@ public class ProxyFrame extends AppFrame implements ActionListener, CatchedListe setVisible(false); } }); - java.util.List images = new ArrayList<>(); + List images = new ArrayList<>(); images.add(View.loadImage("proxy16")); images.add(View.loadImage("proxy32")); setIconImages(images); @@ -271,7 +272,7 @@ public class ProxyFrame extends AppFrame implements ActionListener, CatchedListe started = false; return; } - java.util.List catchedContentTypes = new ArrayList<>(); + List catchedContentTypes = new ArrayList<>(); catchedContentTypes.add("application/x-shockwave-flash"); catchedContentTypes.add("application/x-javascript"); catchedContentTypes.add("application/javascript"); diff --git a/src/com/jpexs/decompiler/flash/gui/timeline/TimelineFrame.java b/src/com/jpexs/decompiler/flash/gui/timeline/TimelineFrame.java index 4d5a45535..538b93b79 100644 --- a/src/com/jpexs/decompiler/flash/gui/timeline/TimelineFrame.java +++ b/src/com/jpexs/decompiler/flash/gui/timeline/TimelineFrame.java @@ -1,49 +1,50 @@ -/* - * 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 . - */ -package com.jpexs.decompiler.flash.gui.timeline; - -import com.jpexs.decompiler.flash.gui.AppFrame; -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.Image; -import java.util.ArrayList; - -/** - * - * @author JPEXS - */ -public class TimelineFrame extends AppFrame { - - public TimelinePanel timeline; - - public TimelineFrame(Timelined timelined) { - setSize(800, 600); - View.setWindowIcon(this); - View.centerScreen(this); - setTitle(translate("dialog.title")); - Container cnt = getContentPane(); - cnt.setLayout(new BorderLayout()); - cnt.add(timeline = new TimelinePanel(timelined), BorderLayout.CENTER); - - java.util.List images = new ArrayList<>(); - images.add(View.loadImage("timeline16")); - images.add(View.loadImage("timeline32")); - setIconImages(images); - } -} +/* + * 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 . + */ +package com.jpexs.decompiler.flash.gui.timeline; + +import com.jpexs.decompiler.flash.gui.AppFrame; +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.Image; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author JPEXS + */ +public class TimelineFrame extends AppFrame { + + public TimelinePanel timeline; + + public TimelineFrame(Timelined timelined) { + setSize(800, 600); + View.setWindowIcon(this); + View.centerScreen(this); + setTitle(translate("dialog.title")); + Container cnt = getContentPane(); + cnt.setLayout(new BorderLayout()); + cnt.add(timeline = new TimelinePanel(timelined), BorderLayout.CENTER); + + List images = new ArrayList<>(); + images.add(View.loadImage("timeline16")); + images.add(View.loadImage("timeline32")); + setIconImages(images); + } +}