Package com.formdev.flatlaf.themeeditor
Class FlatThemeFileEditor
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- com.formdev.flatlaf.themeeditor.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.JFrameTODO
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classFlatThemeFileEditor.DirectoryComboBoxprivate static classFlatThemeFileEditor.DirectoryRendererprivate static classFlatThemeFileEditor.SortedComboBoxModel<E>-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JMenuItemaboutMenuItemprivate javax.swing.JMenuItemactivateEditorMenuItemprivate static java.lang.StringCLASS_TEMPLATEprivate javax.swing.JPanelcontrolPanelprivate javax.swing.JRadioButtonMenuItemdarkLafMenuItemprivate javax.swing.JMenuItemdecrFontSizeMenuItemprivate java.io.Filedirprivate javax.swing.JComboBox<java.io.File>directoryFieldprivate javax.swing.JLabeldirectoryLabelprivate javax.swing.JMenueditMenuprivate javax.swing.JMenuItemexitMenuItemprivate javax.swing.JMenufileMenuprivate javax.swing.JMenuItemfindMenuItemprivate javax.swing.JMenuhelpMenuprivate javax.swing.JMenuItemincrFontSizeMenuItemprivate booleaninLoadDirectoryprivate javax.swing.JMenuIteminsertColorMenuItemprivate static java.lang.StringKEY_DIRECTORIESprivate static java.lang.StringKEY_FONT_SIZE_INCRprivate static java.lang.StringKEY_LAFprivate static java.lang.StringKEY_PREVIEWprivate static java.lang.StringKEY_RECENT_DIRECTORYprivate static java.lang.StringKEY_RECENT_FILEprivate static java.lang.StringKEY_SHOW_COLOR_LUMAprivate static java.lang.StringKEY_SHOW_HSL_COLORSprivate static java.lang.StringKEY_SHOW_RGB_COLORSprivate static java.lang.StringKEY_WINDOW_BOUNDSprivate javax.swing.JRadioButtonMenuItemlightLafMenuItemprivate javax.swing.JMenuBarmenuBarprivate javax.swing.JButtonnewButtonprivate javax.swing.JMenuItemnewPropertiesFileMenuItemprivate javax.swing.JMenuItemnextEditorMenuItemprivate javax.swing.JButtonopenDirectoryButtonprivate javax.swing.JMenuItemopenDirectoryMenuItemprivate javax.swing.JMenuItempickColorMenuItem(package private) static java.lang.StringPREFS_ROOT_PATHprivate javax.swing.JCheckBoxMenuItempreviewMenuItemprivate javax.swing.JMenuItempreviousEditorMenuItemprivate FlatThemePropertiesBaseManagerpropertiesBaseManagerprivate javax.swing.JMenuItemresetFontSizeMenuItemprivate javax.swing.JMenuItemsaveAllMenuItemprivate javax.swing.JCheckBoxMenuItemshowColorLumaMenuItemprivate javax.swing.JCheckBoxMenuItemshowHSLColorsMenuItemprivate javax.swing.JCheckBoxMenuItemshowRGBColorsMenuItemprivate java.util.prefs.Preferencesstateprivate FlatTabbedPanetabbedPaneprivate javax.swing.JMenuviewMenuprivate javax.swing.JMenuwindowMenu-
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Modifier Constructor Description privateFlatThemeFileEditor(java.io.File dir)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidabout()private voidactivateEditor()private voidapplyFontSizeIncr(int sizeIncr)private voidapplyLookAndFeel(java.lang.String lafClassName)private booleancheckDirectory(java.awt.Component parentComponent, java.io.File dir)private voidcolorModelChanged()private voidcreateTheme(java.io.File file, java.lang.String baseTheme)private voidcreateThemeClass(java.io.File dir, java.lang.String themeName, java.lang.String baseTheme)private voiddarkLaf()private voiddecrFontSize()private voiddirectoryChanged()private voidenableDisableActions()private voidexit()private voidfind()private java.io.FilegetCanonicalFile(java.io.File dir)private intgetFontSizeIncr()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 voidincrFontSize()private voidinitComponents()private voidinsertColor()(package private) static voidlaunch(java.lang.String[] args)private voidlightLaf()private voidloadDirectory(java.io.File dir)private booleannewPropertiesFile()private booleannewPropertiesFile(java.io.File dir)private voidnextEditor()private voidnotifyEditorSelected()private voidnotifyTabbedPaneAction(javax.swing.Action action)private voidopenDirectory()private voidopenFile(java.io.File file, boolean select)private voidpickColor()private voidpreviousEditor()(package private) static voidputPrefsBoolean(java.util.prefs.Preferences prefs, java.lang.String key, boolean value, boolean defaultValue)(package private) static voidputPrefsString(java.util.prefs.Preferences prefs, java.lang.String key, java.lang.String value)private static voidputPrefsStrings(java.util.prefs.Preferences prefs, java.lang.String key, java.lang.String[] strings)private voidresetFontSize()private voidrestoreState()private voidrestoreWindowBounds()private booleansaveAll()private voidsaveState()private voidsaveWindowBounds()private voidselectedTabChanged()private voidshowHidePreview()private java.lang.StringtoSortName(java.lang.String name)private voidupdateDirectory()private voidwindowActivated()private voidwindowClosing()private voidwindowDeactivated()private static voidwriteFile(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
-
-
-
-
Field Detail
-
PREFS_ROOT_PATH
static final java.lang.String PREFS_ROOT_PATH
- See Also:
- Constant Field Values
-
KEY_DIRECTORIES
private static final java.lang.String KEY_DIRECTORIES
- See Also:
- Constant Field Values
-
KEY_RECENT_DIRECTORY
private static final java.lang.String KEY_RECENT_DIRECTORY
- See Also:
- Constant Field Values
-
KEY_RECENT_FILE
private static final java.lang.String KEY_RECENT_FILE
- See Also:
- Constant Field Values
-
KEY_WINDOW_BOUNDS
private static final java.lang.String KEY_WINDOW_BOUNDS
- See Also:
- Constant Field Values
-
KEY_PREVIEW
private static final java.lang.String KEY_PREVIEW
- See Also:
- Constant Field Values
-
KEY_LAF
private static final java.lang.String KEY_LAF
- 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
-
propertiesBaseManager
private final FlatThemePropertiesBaseManager propertiesBaseManager
-
newButton
private final javax.swing.JButton newButton
-
CLASS_TEMPLATE
private static final java.lang.String CLASS_TEMPLATE
- See Also:
- Constant Field Values
-
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
-
tabbedPane
private FlatTabbedPane tabbedPane
-
-
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()
-
getThemeEditorPanes
private FlatThemeEditorPane[] getThemeEditorPanes()
-
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()
-
-