Package org.freeplane.core.ui.components
Class UITools
java.lang.Object
org.freeplane.core.ui.components.UITools
Utilities for accessing the GUI, creating dialogs etc.: In scripts available as "global variable"
ui
.
In scripts this would be a simple way of opening a info popup:
ui.informationMessage("Hello World!") ui.informationMessage(ui.frame, "Hello World!") // longer version, equivalent
- Since:
- 29.12.2008
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static final class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addEscapeActionToDialog
(JDialog dialog) static void
addEscapeActionToDialog
(JDialog dialog, Action action) static void
addKeyActionToDialog
(JDialog dialog, Action action, String keyStroke, String actionId) static void
addScrollbarIncrementPropertyListener
(JScrollPane scrollPane) static TitledBorder
addTitledBorder
(JComponent c, String title, float size) static void
static void
convertPointFromAncestor
(Component ancestor, Point p, Component c) static void
convertPointToAncestor
(Component from, Point p, Component destination) static void
convertPointToAncestor
(Component source, Point point, Class<?> ancestorClass) static void
convertRectangleToAncestor
(Component from, Rectangle r, Component destination) static JDialog
createCancelDialog
(Component component, String title, String text) static JDialog
createCancelDialog
(Component component, String title, String text, String buttonText) static JButton
createHtmlLinkStyleButton
(URI uri, String title) static BasicStroke
createStroke
(float width, int[] dash, int join) static void
errorMessage
(Object message) static void
executeWhenNodeHasFocus
(Runnable runnable) static Point
findBestLocation
(Component placedComponent, Component displayedComponent) static void
focusOn
(JComponent component) static Rectangle
static final int
getComponentIndex
(Component component) static Frame
static Component
static Font
static Color
static Frame
getFrame()
static JTabbedPane
static KeyStroke
getKeyStroke
(String keyStrokeDescription) returns a KeyStroke if possible and null otherwise.static Component
static Rectangle
getScreenBounds
(GraphicsConfiguration graphicsConfiguration) static Color
getTextColorForBackground
(Color color) static Font
static Font
getUIFont
(float scalingFactor) static int
getUIFontSize
(double scalingFactor) static int
getUIFontSize
(float scalingFactor) static Rectangle
getValidFrameBounds
(Component frame, int win_x, int win_y, int win_width, int win_height) static void
informationMessage
(Component frame, Object message) static void
informationMessage
(Component frame, Object message, String title) static void
informationMessage
(Component frame, Object text, String title, int type) static void
informationMessage
(Object message) static Font
invertScale
(Font font) static boolean
static boolean
static boolean
static boolean
static String
keyStrokeToString
(KeyStroke keyStroke) formats a KeyStroke in a ledgible way, e.g.static JFileChooser
static JFileChooser
newFileChooser
(File directory) static void
repaintAll
(Container root) static void
static Font
static Font
scaleFontInt
(Font font, double additionalFactor) static Font
static void
static void
setDialogLocationRelativeTo
(JDialog dialog, Component c) static void
setDialogLocationRelativeTo
(JDialog dialog, org.freeplane.features.map.NodeModel node) static void
setDialogLocationUnder
(JDialog dialog, org.freeplane.features.map.NodeModel node) static void
setScrollbarIncrement
(JScrollPane scrollPane) static void
Shows the error message "attributes_adding_empty_attribute_error"static int
showConfirmDialog
(org.freeplane.features.map.NodeModel node, Object message, String title, int optionType) static int
showConfirmDialog
(org.freeplane.features.map.NodeModel node, Object message, String title, int optionType, int messageType) static void
static String
showInputDialog
(org.freeplane.features.map.NodeModel node, String message, String initialValue) static String
showInputDialog
(org.freeplane.features.map.NodeModel node, String text, String title, int type) static void
showMessage
(String message, int messageType)
-
Field Details
-
MAIN_FREEPLANE_FRAME
- See Also:
-
SCROLLBAR_INCREMENT
- See Also:
-
MAX_BUTTON_DIMENSION
-
FONT_SCALE_FACTOR
public static final float FONT_SCALE_FACTOR
-
-
Constructor Details
-
UITools
public UITools()
-
-
Method Details
-
addEscapeActionToDialog
-
addEscapeActionToDialog
-
addKeyActionToDialog
-
convertPointFromAncestor
-
convertPointToAncestor
-
convertRectangleToAncestor
-
convertPointToAncestor
-
errorMessage
-
getCurrentRootComponent
-
getCurrentFrame
-
getFrame
-
getMenuComponent
-
getKeyStroke
returns a KeyStroke if possible and null otherwise. -
keyStrokeToString
formats a KeyStroke in a ledgible way, e.g. Control+V. Null is converted to "". Taken from MotifGraphicsUtils.paintMenuItem(). -
informationMessage
-
informationMessage
-
informationMessage
-
informationMessage
-
setBounds
-
getValidFrameBounds
-
getAvailableScreenBounds
-
getScreenBounds
-
setDialogLocationRelativeTo
-
findBestLocation
-
setDialogLocationRelativeTo
public static void setDialogLocationRelativeTo(JDialog dialog, org.freeplane.features.map.NodeModel node) -
setDialogLocationUnder
public static void setDialogLocationUnder(JDialog dialog, org.freeplane.features.map.NodeModel node) -
showAttributeEmptyStringErrorMessage
public static void showAttributeEmptyStringErrorMessage()Shows the error message "attributes_adding_empty_attribute_error" -
showMessage
-
showConfirmDialog
-
showConfirmDialog
-
showInputDialog
-
showInputDialog
-
setScrollbarIncrement
-
addScrollbarIncrementPropertyListener
-
getTextColorForBackground
-
getDisabledTextColorForBackground
-
isLight
-
isLighter
-
focusOn
-
createStroke
-
repaintAll
-
createCancelDialog
-
createCancelDialog
-
addTitledBorder
-
backOtherWindows
public static void backOtherWindows() -
createHtmlLinkStyleButton
-
getComponentIndex
-
scale
-
scaleUI
-
scaleFontInt
-
invertScale
-
showFrame
public static void showFrame() -
isEditingText
public static boolean isEditingText() -
executeWhenNodeHasFocus
-
getUIFontSize
public static int getUIFontSize(double scalingFactor) -
getUIFontSize
public static int getUIFontSize(float scalingFactor) -
getUIFont
-
getUIFont
-
getDefaultLabelFont
-
newFileChooser
-
newFileChooser
-
getFreeplaneTabbedPanel
-
isLightLookAndFeelInstalled
public static boolean isLightLookAndFeelInstalled() -
resetMenuBarOnMac
public static void resetMenuBarOnMac()
-