Class FlatThemeFileEditor

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    class FlatThemeFileEditor
    extends javax.swing.JFrame
    TODO
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  FlatThemeFileEditor.DirectoryComboBox  
      private static class  FlatThemeFileEditor.DirectoryRenderer  
      private static class  FlatThemeFileEditor.SortedComboBoxModel<E>  
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FlatThemeFileEditor​(java.io.File dir)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void about()  
      private void activateEditor()  
      private void applyFontSizeIncr​(int sizeIncr)  
      private void applyLookAndFeel​(java.lang.String lafClassName)  
      private boolean checkDirectory​(java.awt.Component parentComponent, java.io.File dir)  
      private void colorModelChanged()  
      private void createTheme​(java.io.File file, java.lang.String baseTheme)  
      private void createThemeClass​(java.io.File dir, java.lang.String themeName, java.lang.String baseTheme)  
      private void darkLaf()  
      private void decrFontSize()  
      private void directoryChanged()  
      private void enableDisableActions()  
      private void exit()  
      private void find()  
      private java.io.File getCanonicalFile​(java.io.File dir)  
      private int getFontSizeIncr()  
      private static java.lang.String[] getPrefsStrings​(java.util.prefs.Preferences prefs, java.lang.String key)  
      private java.io.File[] getPropertiesFiles​(java.io.File dir)  
      private FlatThemeEditorPane[] getThemeEditorPanes()  
      private void incrFontSize()  
      private void initComponents()  
      private void insertColor()  
      (package private) static void launch​(java.lang.String[] args)  
      private void lightLaf()  
      private void loadDirectory​(java.io.File dir)  
      private boolean newPropertiesFile()  
      private boolean newPropertiesFile​(java.io.File dir)  
      private void nextEditor()  
      private void notifyEditorSelected()  
      private void notifyTabbedPaneAction​(javax.swing.Action action)  
      private void openDirectory()  
      private void openFile​(java.io.File file, boolean select)  
      private void pickColor()  
      private void previousEditor()  
      (package private) static void putPrefsBoolean​(java.util.prefs.Preferences prefs, java.lang.String key, boolean value, boolean defaultValue)  
      (package private) static void putPrefsString​(java.util.prefs.Preferences prefs, java.lang.String key, java.lang.String value)  
      private static void putPrefsStrings​(java.util.prefs.Preferences prefs, java.lang.String key, java.lang.String[] strings)  
      private void resetFontSize()  
      private void restoreState()  
      private void restoreWindowBounds()  
      private boolean saveAll()  
      private void saveState()  
      private void saveWindowBounds()  
      private void selectedTabChanged()  
      private void showHidePreview()  
      private java.lang.String toSortName​(java.lang.String name)  
      private void updateDirectory()  
      private void windowActivated()  
      private void windowClosing()  
      private void windowDeactivated()  
      private static void writeFile​(java.io.File file, java.lang.String content)  
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • KEY_RECENT_DIRECTORY

        private static final java.lang.String KEY_RECENT_DIRECTORY
        See Also:
        Constant Field Values
      • KEY_WINDOW_BOUNDS

        private static final java.lang.String KEY_WINDOW_BOUNDS
        See Also:
        Constant Field Values
      • KEY_FONT_SIZE_INCR

        private static final java.lang.String KEY_FONT_SIZE_INCR
        See Also:
        Constant Field Values
      • KEY_SHOW_HSL_COLORS

        private static final java.lang.String KEY_SHOW_HSL_COLORS
        See Also:
        Constant Field Values
      • KEY_SHOW_RGB_COLORS

        private static final java.lang.String KEY_SHOW_RGB_COLORS
        See Also:
        Constant Field Values
      • KEY_SHOW_COLOR_LUMA

        private static final java.lang.String KEY_SHOW_COLOR_LUMA
        See Also:
        Constant Field Values
      • dir

        private java.io.File dir
      • state

        private java.util.prefs.Preferences state
      • inLoadDirectory

        private boolean inLoadDirectory
      • newButton

        private final javax.swing.JButton newButton
      • menuBar

        private javax.swing.JMenuBar menuBar
      • fileMenu

        private javax.swing.JMenu fileMenu
      • openDirectoryMenuItem

        private javax.swing.JMenuItem openDirectoryMenuItem
      • newPropertiesFileMenuItem

        private javax.swing.JMenuItem newPropertiesFileMenuItem
      • saveAllMenuItem

        private javax.swing.JMenuItem saveAllMenuItem
      • exitMenuItem

        private javax.swing.JMenuItem exitMenuItem
      • editMenu

        private javax.swing.JMenu editMenu
      • findMenuItem

        private javax.swing.JMenuItem findMenuItem
      • insertColorMenuItem

        private javax.swing.JMenuItem insertColorMenuItem
      • pickColorMenuItem

        private javax.swing.JMenuItem pickColorMenuItem
      • viewMenu

        private javax.swing.JMenu viewMenu
      • previewMenuItem

        private javax.swing.JCheckBoxMenuItem previewMenuItem
      • lightLafMenuItem

        private javax.swing.JRadioButtonMenuItem lightLafMenuItem
      • darkLafMenuItem

        private javax.swing.JRadioButtonMenuItem darkLafMenuItem
      • incrFontSizeMenuItem

        private javax.swing.JMenuItem incrFontSizeMenuItem
      • decrFontSizeMenuItem

        private javax.swing.JMenuItem decrFontSizeMenuItem
      • resetFontSizeMenuItem

        private javax.swing.JMenuItem resetFontSizeMenuItem
      • showHSLColorsMenuItem

        private javax.swing.JCheckBoxMenuItem showHSLColorsMenuItem
      • showRGBColorsMenuItem

        private javax.swing.JCheckBoxMenuItem showRGBColorsMenuItem
      • showColorLumaMenuItem

        private javax.swing.JCheckBoxMenuItem showColorLumaMenuItem
      • windowMenu

        private javax.swing.JMenu windowMenu
      • activateEditorMenuItem

        private javax.swing.JMenuItem activateEditorMenuItem
      • nextEditorMenuItem

        private javax.swing.JMenuItem nextEditorMenuItem
      • previousEditorMenuItem

        private javax.swing.JMenuItem previousEditorMenuItem
      • helpMenu

        private javax.swing.JMenu helpMenu
      • aboutMenuItem

        private javax.swing.JMenuItem aboutMenuItem
      • controlPanel

        private javax.swing.JPanel controlPanel
      • directoryLabel

        private javax.swing.JLabel directoryLabel
      • directoryField

        private javax.swing.JComboBox<java.io.File> directoryField
      • openDirectoryButton

        private javax.swing.JButton openDirectoryButton
    • Constructor Detail

      • FlatThemeFileEditor

        private FlatThemeFileEditor​(java.io.File dir)
    • Method Detail

      • launch

        static void launch​(java.lang.String[] args)
      • openDirectory

        private void openDirectory()
      • checkDirectory

        private boolean checkDirectory​(java.awt.Component parentComponent,
                                       java.io.File dir)
      • directoryChanged

        private void directoryChanged()
      • loadDirectory

        private void loadDirectory​(java.io.File dir)
      • updateDirectory

        private void updateDirectory()
      • getCanonicalFile

        private java.io.File getCanonicalFile​(java.io.File dir)
      • getPropertiesFiles

        private java.io.File[] getPropertiesFiles​(java.io.File dir)
      • toSortName

        private java.lang.String toSortName​(java.lang.String name)
      • openFile

        private void openFile​(java.io.File file,
                              boolean select)
      • selectedTabChanged

        private void selectedTabChanged()
      • enableDisableActions

        private void enableDisableActions()
      • newPropertiesFile

        private boolean newPropertiesFile()
      • newPropertiesFile

        private boolean newPropertiesFile​(java.io.File dir)
      • createTheme

        private void createTheme​(java.io.File file,
                                 java.lang.String baseTheme)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • createThemeClass

        private void createThemeClass​(java.io.File dir,
                                      java.lang.String themeName,
                                      java.lang.String baseTheme)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • writeFile

        private static void writeFile​(java.io.File file,
                                      java.lang.String content)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • saveAll

        private boolean saveAll()
      • exit

        private void exit()
      • windowClosing

        private void windowClosing()
      • windowActivated

        private void windowActivated()
      • windowDeactivated

        private void windowDeactivated()
      • notifyEditorSelected

        private void notifyEditorSelected()
      • activateEditor

        private void activateEditor()
      • nextEditor

        private void nextEditor()
      • previousEditor

        private void previousEditor()
      • notifyTabbedPaneAction

        private void notifyTabbedPaneAction​(javax.swing.Action action)
      • find

        private void find()
      • insertColor

        private void insertColor()
      • pickColor

        private void pickColor()
      • showHidePreview

        private void showHidePreview()
      • lightLaf

        private void lightLaf()
      • darkLaf

        private void darkLaf()
      • applyLookAndFeel

        private void applyLookAndFeel​(java.lang.String lafClassName)
      • incrFontSize

        private void incrFontSize()
      • decrFontSize

        private void decrFontSize()
      • resetFontSize

        private void resetFontSize()
      • applyFontSizeIncr

        private void applyFontSizeIncr​(int sizeIncr)
      • getFontSizeIncr

        private int getFontSizeIncr()
      • colorModelChanged

        private void colorModelChanged()
      • about

        private void about()
      • restoreState

        private void restoreState()
      • saveState

        private void saveState()
      • restoreWindowBounds

        private void restoreWindowBounds()
      • saveWindowBounds

        private void saveWindowBounds()
      • putPrefsBoolean

        static void putPrefsBoolean​(java.util.prefs.Preferences prefs,
                                    java.lang.String key,
                                    boolean value,
                                    boolean defaultValue)
      • putPrefsString

        static void putPrefsString​(java.util.prefs.Preferences prefs,
                                   java.lang.String key,
                                   java.lang.String value)
      • getPrefsStrings

        private static java.lang.String[] getPrefsStrings​(java.util.prefs.Preferences prefs,
                                                          java.lang.String key)
      • putPrefsStrings

        private static void putPrefsStrings​(java.util.prefs.Preferences prefs,
                                            java.lang.String key,
                                            java.lang.String[] strings)
      • initComponents

        private void initComponents()