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
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
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 void
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 titel, String text) 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 Frame
getFrame()
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 float
getUIFontSize
(double scalingFactor) static Rectangle
getValidFrameBounds
(Component frame, int win_x, int win_y, int win_width, int win_height) static void
informationMessage
(Component frame, String message) static void
informationMessage
(Component frame, String message, String title) static void
informationMessage
(Component frame, String text, String string, int type) static void
informationMessage
(String message) static Font
invertScale
(Font font) static boolean
static String
keyStrokeToString
(KeyStroke keyStroke) formats a KeyStroke in a ledgible way, e.g.static void
repaintAll
(Container root) 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 boolean
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) static float[]
toFloats
(int[] dash)
-
Field Details
-
MENU_ITEM_FONT_SIZE_PROPERTY
- See Also:
-
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
-
focusOn
-
createStroke
-
toFloats
public static float[] toFloats(int[] dash) -
repaintAll
-
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 float getUIFontSize(double scalingFactor) -
getDefaultLabelFont
-
shouldScaleUIFonts
public static boolean shouldScaleUIFonts()
-