Package com.illumon.iris.gui.util
Class IrisGuiUtil
java.lang.Object
com.illumon.iris.gui.util.IrisGuiUtil
Contains some static helper methods to create and manipulate GUI objects.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddCopyPasteMenu(JPopupMenu menu, JTextArea textArea) Given a textarea, add a Copy/Cut/Paste menu to the passed in menu.static voidaddDocumentChangeCallback(Document document, Runnable runnable) static voidaddDocumentChangeCallback(JTextComponent textComponent, Runnable runnable) static voidaddMutualExclusionRadioButton(JRadioButton radioButton, List<JComponent> enableComponents, List<JComponent> disableComponents) static ColoradjustAlpha(int a, Color c) static voidbindCheckboxToTextComponent(JTextComponent textComponent, JCheckBox checkBox) static voidcenterOnScreen(Window win) static JPanelcenterWrap(JComponent com) static voidClears the alert color with colored child checkingstatic intcountViews(com.illumon.infonode.docking.DockingWindow window) createEmptyDialog(Component parent, String title) Create an empty dialog, with a JPanel that we can put stuff in.static voidCreate an editable text area within dialog, returning the text on OK.static voideditableTextAreaDialog(Component parent, String title, String value, Consumer<String> onOk, Dialog.ModalityType modalityType) Create an editable text area within dialog, returning the text on OK.static com.illumon.infonode.docking.DockingWindowstatic Imagestatic com.illumon.infonode.docking.DockingWindowgetDockingWindow(Component startComponent) static ErrorReporterGet the globalErrorReporterfor reporting unexpected errors to the user.static JScrollPanegetScrollableTextArea(String value) static com.fishlib.base.Pair<JScrollPane,JTextArea> getScrollableTextArea(String value, boolean editable) static com.illumon.infonode.docking.TabWindowgetTabWindow(com.illumon.infonode.docking.DockingWindow window) static com.illumon.infonode.docking.Viewstatic StringgetViewTitle(Component com) static voidinitPropsAndLogs(String appName) static booleanstatic ColorlookupColorString(String colorString) static ColorlookupColorString(String colorString, UIDefaults uiDefaults) static JScrollPanemakeScrollableTextArea(String message, Dimension dim) Create a scrollable, non-editable text area with the given message.static <V extends io.deephaven.enterprise.base.stats.Value>
io.deephaven.enterprise.base.stats.Item<V>makeUniqueItem(String groupName, String itemName, com.fishlib.base.Function.Unary<V, Long> valueFactory, String description) static voidstatic voidrestore(com.illumon.infonode.docking.RootWindow rootWindow, com.illumon.infonode.docking.util.StringViewMap viewMap, String viewName) static voidrestore(com.illumon.infonode.docking.RootWindow rootWindow, com.illumon.infonode.docking.View view) static voidrestoreAllViews(com.illumon.infonode.docking.RootWindow rootWindow, com.illumon.infonode.docking.util.StringViewMap viewMap, List excludeList) static Colorstatic voidsetErrorReporter(ErrorReporter reporter) Set the globalErrorReporterfor reporting unexpected errors to the user.static voidsetSplitLocation(JSplitPane pane, double percentPosition) Set the location of aJSplitPanedivider.static voidsetTabColor(com.illumon.infonode.docking.DockingWindow dw, Color normalColor, Color highlightColor) Sets the raw value of the color without checking for any previous colorstatic voidsetViewTabAlertColor(Component com, Color color, boolean alertColorPropagates) Sets the alert color of this view.static voidsetViewTabTempColor(Component com, Color color, boolean tempColorPropagates) Sets the temp color of this view.static StringshowInputAreaDialog(Component parentComponent, String message, String initialSelectionValue) static voidshowTextAreaDialog(Component parent, String title, String value) Create a scrollable, non-editable text area within dialog.static voidtextAreaDialog(boolean editable, Component parent, String title, String value, Consumer<String> onOk, Dialog.ModalityType modalityType) Create an editable text area within dialog, returning the text on OK.static JPanelstatic JPanelstatic JPanelstatic JPanel
-
Field Details
-
IRIS_ICON_PROPERTY
- See Also:
-
-
Constructor Details
-
IrisGuiUtil
public IrisGuiUtil()
-
-
Method Details
-
getDefaultDialogIcon
-
refreshAllWindows
public static void refreshAllWindows() -
showInputAreaDialog
-
setViewTabTempColor
Sets the temp color of this view. colors "trickle up" so all ancestor windows will also get this color- Parameters:
com- the component that is the child of a colorable tabcolor- the color to set
-
setViewTabAlertColor
Sets the alert color of this view. Alerts will "trickle up" so any ancestor will also get the alert color applied- Parameters:
com- the component causing the alertcolor- the color of the alert
-
clearAlertTabColor
Clears the alert color with colored child checking- Parameters:
com- the component whose ancestor will be colored
-
setTabColor
public static void setTabColor(com.illumon.infonode.docking.DockingWindow dw, Color normalColor, Color highlightColor) Sets the raw value of the color without checking for any previous color- Parameters:
dw- the docking window to be colorednormalColor- the normal color to be sethighlightColor- the highlight color to be set
-
getViewTitle
-
makeUniqueItem
-
isNumber
-
centerOnScreen
-
getView
-
wrap
-
wrap
-
wrapBorder
-
wrapBox
-
centerWrap
-
getTabWindow
public static com.illumon.infonode.docking.TabWindow getTabWindow(com.illumon.infonode.docking.DockingWindow window) -
restoreAllViews
public static void restoreAllViews(com.illumon.infonode.docking.RootWindow rootWindow, com.illumon.infonode.docking.util.StringViewMap viewMap, List excludeList) -
restore
public static void restore(com.illumon.infonode.docking.RootWindow rootWindow, com.illumon.infonode.docking.View view) -
restore
public static void restore(com.illumon.infonode.docking.RootWindow rootWindow, com.illumon.infonode.docking.util.StringViewMap viewMap, String viewName) -
findView
public static com.illumon.infonode.docking.DockingWindow findView(com.illumon.infonode.docking.DockingWindow window, String name) -
countViews
public static int countViews(com.illumon.infonode.docking.DockingWindow window) -
initPropsAndLogs
-
makeScrollableTextArea
Create a scrollable, non-editable text area with the given message.- Parameters:
message- message to display in the text boxdim- optional preferred size for the text area- Returns:
- JScrollPane containing a text area
-
showTextAreaDialog
Create a scrollable, non-editable text area within dialog.- Parameters:
parent- parent component for the dialogtitle- title of the dialogvalue- message to display in the text box
-
editableTextAreaDialog
public static void editableTextAreaDialog(Component parent, String title, String value, Consumer<String> onOk) Create an editable text area within dialog, returning the text on OK.- Parameters:
parent- parent component for the dialogtitle- title of the dialogvalue- message to display in the text box
-
editableTextAreaDialog
public static void editableTextAreaDialog(Component parent, String title, String value, Consumer<String> onOk, Dialog.ModalityType modalityType) Create an editable text area within dialog, returning the text on OK.- Parameters:
parent- parent component for the dialogtitle- title of the dialogvalue- message to display in the text box
-
textAreaDialog
public static void textAreaDialog(boolean editable, Component parent, String title, String value, @NotNull Consumer<String> onOk, Dialog.ModalityType modalityType) Create an editable text area within dialog, returning the text on OK.- Parameters:
parent- parent component for the dialogtitle- title of the dialogvalue- message to display in the text boxmodalityType- the modality type for the dialog
-
getScrollableTextArea
-
getScrollableTextArea
@NotNull public static com.fishlib.base.Pair<JScrollPane,JTextArea> getScrollableTextArea(String value, boolean editable) -
addCopyPasteMenu
Given a textarea, add a Copy/Cut/Paste menu to the passed in menu.- Parameters:
menu- the popup menu that we'll add our components totextArea- the textArea that we'll be modifying
-
createEmptyDialog
public static com.fishlib.base.Pair<JFrame,JPanel> createEmptyDialog(Component parent, String title) Create an empty dialog, with a JPanel that we can put stuff in.- Parameters:
parent- parent component for the dialogtitle- title of the dialog
-
addDocumentChangeCallback
-
addDocumentChangeCallback
-
lookupColorString
-
lookupColorString
-
scale
-
adjustAlpha
-
bindCheckboxToTextComponent
-
setSplitLocation
Set the location of a
JSplitPanedivider.This method handles the fact that
JSplitPane.setDividerLocation(double)is a lie if the view has not been completely drawn yet. We need to wait for the window to be resized to _both_ it's internal sizes before we call setDividerLocation, otherwise the divider will not move to where it's supposed to.- Parameters:
pane- The pane to set the divider forpercentPosition- The position of the divider
-
getDockingWindow
-
addMutualExclusionRadioButton
public static void addMutualExclusionRadioButton(JRadioButton radioButton, List<JComponent> enableComponents, List<JComponent> disableComponents) -
getErrorReporter
Get the globalErrorReporterfor reporting unexpected errors to the user.- Returns:
- the error reporter.
-
setErrorReporter
Set the globalErrorReporterfor reporting unexpected errors to the user.- Parameters:
reporter- the reporter to use
-