Documentation of 'jv.object.PsPanel' Java class
PsPanel ("JavaView Reference Manual")
"JavaView? v5.03.003"
jv.object

Class PsPanel

    • Nested Class Summary

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

        java.awt.Component.BaselineResizeBehavior
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int BORDER_GROOVE 
      static int BORDER_LINE 
      static int BORDER_LINETOP 
      static int BORDER_NONE 
      static int BORDER_SUNK 
      static java.lang.String BOUNDARY
      Name of default boundary panel under which panel is registered in panel list.
      static java.lang.String BOUNDARY_EXT
      File name suffix of boundary panel class to name of base class.
      static java.lang.String CONFIG
      Name of default control panel under which panel is registered in panel list.
      static java.lang.String CONFIG_EXT
      File name suffix of control panel class to name of base class.
      static java.lang.String INFO
      Name of default info panel under which panel is registered in panel list.
      static java.lang.String INFO_EXT
      Identifier of class extension characterizing info panels.
      static java.lang.String LABEL
      Name of default font panel under which panel is registered in panel list.
      static java.lang.String LABEL_EXT
      File name suffix of font panel class to name of base class.
      static java.lang.String MATERIAL
      Name of default material panel under which panel is registered in panel list.
      static java.lang.String MATERIAL_EXT
      File name suffix of material panel class to name of base class.
      static int ORIENT_GUIDE
      Vertical handle of toolbar.
      static int ORIENT_HORIZONTAL
      Default horizontal orientation of lines.
      static int ORIENT_VERTICAL
      Vertical orientation of lines.
      static java.lang.String TEXTURE
      Name of default texture panel under which panel is registered in panel list.
      static java.lang.String TEXTURE_EXT
      File name suffix of texture panel class to name of base class.
      static java.lang.String VECTOR
      Name of default vector panel under which panel is registered in panel list.
      static java.lang.String VECTOR_EXT
      File name suffix of vector panel class to name of base class.
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      PsPanel()
      Constructor of panel with PsStackLayout(1) as default layout manager.
      PsPanel(java.awt.LayoutManager mgr)
      Constructor of panel with given layout manager.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      java.awt.Panel addLabelComponent(java.lang.String label, java.awt.Component comp)
      Add a label and a component in a horizontal panel with GridLayout(1, 2).
      java.awt.Canvas addLine(int size)
      Add a horizontal line with specified thickness as separator.
      java.awt.Canvas addLine(int size, int orient)
      Add a horizontal line with specified thickness as separator.
      java.awt.Label addSubTitle(java.lang.String title)
      Add subtitle to panel in subheader font and return label.
      java.awt.TextField addTextField(java.lang.String label, int length)
      Add a label and textField in a horizontal panel with GridLayout(1, 2).
      java.awt.Label addTitle(java.lang.String title)
      Create main title to panel in header font and add to panel.
      static void drawBorder(java.awt.Component comp, java.awt.Graphics g, int borderType)
      Deprecated. 
      use static void PsPanel.drawBorder(Graphics, borderType, Rectangle);
      void drawBorder(java.awt.Graphics g, int borderType)
      Draw border around this panel.
      static void drawBorder(java.awt.Graphics g, int borderType, java.awt.Rectangle rectangle)
      Draw a rectangle into the given graphics context.
      static void drawBorder(java.awt.Graphics g, int borderType, java.awt.Rectangle rectangle, java.awt.Color color)
      Draw a rectangle into the given graphics context with given color.
      void drawText(java.awt.Graphics g, java.awt.Point point, java.lang.String string)
      Draw text at specified position.
      PsUpdateIf getFather()
      Get the parent of this panel which receives update events.
      java.awt.Insets getInsets()
      Overwrite Container.getInsets() to create a border measured in pixels around this panel.
      java.lang.String getLanguage()
      Deprecated. 
      Method is no longer used to decide about recreation of panel.
      int getPanelVersion()
      Get panel version of this panel to compare with panel version of PsConfig for decision if panel needs to be recreated.
      java.awt.Dimension getPreferredSize()
      Get the assigned preferred size, or whatever super provides.
      java.awt.Label getTitle()
      Get the main title label, or null of no title exists.
      java.awt.Label getTitle(java.lang.String title)
      Create a new main title label with given string and standard font.
      java.awt.Label getTitle(java.lang.String title, java.awt.Font font)
      Create a new main title label with given string and font.
      boolean hasTitle()
      Check whether panel has a main title label.
      void init()
      Provides layout and adds internal components.
      boolean instanceOf(java.lang.String aClassName)
      Deprecated. 
      use "if (getClass() == PsObject.class)" instead
      void paint(java.awt.Graphics g)
      Call super.paint(g) and draw border around panel.
      void removeTitle()
      Remove label of panel title from this panel.
      static boolean select(java.awt.Choice widget, int index)
      Update the selected index of a choice if the new index is different from the current selection of the widget.
      void setBackColor(java.awt.Color col)
      Assigned explicit background color such that container is not transparent.
      void setBorderType(int borderType)
      Set border of panel which is automatically drawn.
      static boolean setEnabled(java.awt.Component widget, boolean bEnable)
      Assure that a component is enabled if requested.
      void setImage(java.awt.Image image)
      Image to be shown in the background of the canvas and set layout to null.
      void setInsetSize(int size)
      Set the global inset size.
      void setInsetSizeHorizontal(int size)
      Set the vertical inset size to be used at top and bottom of this panel.
      void setInsetSizeVertical(int size)
      Set the vertical inset size to be used at top and bottom of this panel.
      static boolean setLabel(java.awt.Button widget, java.lang.String text)
      Set the label of a button if it is different from the current label.
      static boolean setLabel(java.awt.Checkbox widget, java.lang.String text)
      Set the label of a checkbox if it is different from the current label.
      void setOutOfDate(boolean state)
      Mark this panel as being not synchronized with the correct data of its parent.
      void setParent(PsUpdateIf parent)
      Set parent of this panel which receives update events.
      void setPreferredSize(int width, int height)
      Assigned preferred size.
      static boolean setSelectedCheckbox(java.awt.CheckboxGroup widget, java.awt.Checkbox checkbox)
      In a checkbox group selected a checkbox if it is different from the current selection of the widget.
      static boolean setState(java.awt.Checkbox widget, boolean bState)
      Assure that a checkbox has same state than corresponding boolean flag.
      static boolean setText(java.awt.Label widget, java.lang.String text)
      Update the content of a label if the new content is different from the current content of the widget.
      static boolean setText(java.awt.TextComponent widget, java.lang.String text)
      Update the content of a text field if the new content is different from the current content of the widget.
      void setTitle(java.lang.String title)
      Set string of main title of panel but do not add title to panel.
      void setVisible(boolean flag)
      Override Component.setVisible(boolean) to give panel a chance to update its content when is becomes visible.
      void update(java.awt.Graphics g)
      Override Component.update(Graphics) to avoid clearing the component if an image is available.
      boolean update(java.lang.Object event)
      Update this objects whenever parent or a child has changed, and continue update sequence.
      • Methods inherited from class java.awt.Panel

        addNotify, getAccessibleContext
      • Methods inherited from class java.awt.Container

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

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

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • BOUNDARY_EXT

        public static final java.lang.String BOUNDARY_EXT
        File name suffix of boundary panel class to name of base class.
        See Also:
        Constant Field Values
      • BOUNDARY

        public static final java.lang.String BOUNDARY
        Name of default boundary panel under which panel is registered in panel list.
        See Also:
        Constant Field Values
      • CONFIG_EXT

        public static final java.lang.String CONFIG_EXT
        File name suffix of control panel class to name of base class.
        See Also:
        Constant Field Values
      • CONFIG

        public static final java.lang.String CONFIG
        Name of default control panel under which panel is registered in panel list.
        See Also:
        Constant Field Values
      • INFO_EXT

        public static final java.lang.String INFO_EXT
        Identifier of class extension characterizing info panels.
        See Also:
        Constant Field Values
      • INFO

        public static final java.lang.String INFO
        Name of default info panel under which panel is registered in panel list.
        See Also:
        Constant Field Values
      • LABEL_EXT

        public static final java.lang.String LABEL_EXT
        File name suffix of font panel class to name of base class.
        See Also:
        Constant Field Values
      • LABEL

        public static final java.lang.String LABEL
        Name of default font panel under which panel is registered in panel list.
        See Also:
        Constant Field Values
      • MATERIAL_EXT

        public static final java.lang.String MATERIAL_EXT
        File name suffix of material panel class to name of base class.
        See Also:
        Constant Field Values
      • MATERIAL

        public static final java.lang.String MATERIAL
        Name of default material panel under which panel is registered in panel list.
        See Also:
        Constant Field Values
      • TEXTURE_EXT

        public static final java.lang.String TEXTURE_EXT
        File name suffix of texture panel class to name of base class.
        See Also:
        Constant Field Values
      • TEXTURE

        public static final java.lang.String TEXTURE
        Name of default texture panel under which panel is registered in panel list.
        See Also:
        Constant Field Values
      • VECTOR_EXT

        public static final java.lang.String VECTOR_EXT
        File name suffix of vector panel class to name of base class.
        See Also:
        Constant Field Values
      • VECTOR

        public static final java.lang.String VECTOR
        Name of default vector panel under which panel is registered in panel list.
        See Also:
        Constant Field Values
      • ORIENT_HORIZONTAL

        public static final int ORIENT_HORIZONTAL
        Default horizontal orientation of lines.
        See Also:
        Constant Field Values
      • ORIENT_VERTICAL

        public static final int ORIENT_VERTICAL
        Vertical orientation of lines.
        See Also:
        Constant Field Values
      • ORIENT_GUIDE

        public static final int ORIENT_GUIDE
        Vertical handle of toolbar.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PsPanel

        public PsPanel()
        Constructor of panel with PsStackLayout(1) as default layout manager.
      • PsPanel

        public PsPanel(java.awt.LayoutManager mgr)
        Constructor of panel with given layout manager. Provides better similarity with java.awt.Panel.
        Since:
        JavaView 2.90.000
        Version:
        11.08.03, 1.00 created (kp)
    • Method Detail

      • init

        public void init()
        Provides layout and adds internal components.
      • getPreferredSize

        public java.awt.Dimension getPreferredSize()
        Get the assigned preferred size, or whatever super provides.
        Overrides:
        getPreferredSize in class java.awt.Container
        Since:
        JavaView 3.13.001
        Version:
        28.03.04, 1.00 created (kp)
      • setPreferredSize

        public void setPreferredSize(int width,
                                     int height)
        Assigned preferred size.
        Since:
        JavaView 3.13.001
        Version:
        28.03.04, 1.00 created (kp)
      • setBackColor

        public void setBackColor(java.awt.Color col)
        Assigned explicit background color such that container is not transparent.
        Since:
        JavaView 3.13.001
        Version:
        28.03.04, 1.00 created (kp)
      • getPanelVersion

        public int getPanelVersion()
        Get panel version of this panel to compare with panel version of PsConfig for decision if panel needs to be recreated. Used, for example, when language of fonts have changed.
        Since:
        JavaView 4.00.008
        Version:
        12.11.12, 1.00 created (kp)
      • getLanguage

        public java.lang.String getLanguage()
        Deprecated. Method is no longer used to decide about recreation of panel.
        Get language used in this panel.
        See Also:
        getPanelVersion()
        Version:
        12.11.12, 2.00 revised (kp) Method deprecated, use getPanelVersion.
      • setImage

        public void setImage(java.awt.Image image)
        Image to be shown in the background of the canvas and set layout to null. Currently, this should only be used if no components are added to panel.

        Functionality might be moved into separate class in some future version.

        Version:
        12.11.00, 1.00 created (kp)
      • setVisible

        public void setVisible(boolean flag)
        Override Component.setVisible(boolean) to give panel a chance to update its content when is becomes visible. Parent of panel usually does not update panel if panel is hidden. TODO: should update only if panel is marked OUTOFDATE.
        Overrides:
        setVisible in class java.awt.Component
      • getFather

        public PsUpdateIf getFather()
        Get the parent of this panel which receives update events. The method setParent allows to set this parent.
        Specified by:
        getFather in interface PsUpdateIf
        Returns:
        parent parent of this panel
        See Also:
        getFather()
      • setParent

        public void setParent(PsUpdateIf parent)
        Set parent of this panel which receives update events.

        The method getFather allows to retrieve this parent.

        Specified by:
        setParent in interface PsUpdateIf
        Parameters:
        parent - parent of this panel
        See Also:
        getFather()
      • update

        public boolean update(java.lang.Object event)
        Update this objects whenever parent or a child has changed, and continue update sequence. Method is usually invoked from the parent or children, i.e. inner components.
        Specified by:
        update in interface PsUpdateIf
        Parameters:
        event - carries a lot of information
        Returns:
        true if event has been handled, otherwise false
        See Also:
        PsObject, PsUpdateIf.getFather(), PsUpdateIf.setParent(PsUpdateIf)
        Version:
        11.08.03, 1.10 revised (kp) Allow event==this which does noting special.
      • instanceOf

        public final boolean instanceOf(java.lang.String aClassName)
        Deprecated. use "if (getClass() == PsObject.class)" instead
        Return true if string is exact classname of current instance. Even if string denotes a super class method returns false. This method is different from Java operator instanceof which is true even if current instance is subclass of class 'aClassName'.
        Parameters:
        aClassName - name of class without package identifiers
        Returns:
        true if current object is exact instance of class
      • getInsets

        public java.awt.Insets getInsets()
        Overwrite Container.getInsets() to create a border measured in pixels around this panel. The border is either uniformly determined by setInsetSize(int) or by, additionally, specifying a vertical inset size using setInsetSizeVertical(int).
        Overrides:
        getInsets in class java.awt.Container
        See Also:
        setInsetSize(int), setInsetSizeVertical(int), setBorderType(int)
      • setInsetSize

        public void setInsetSize(int size)
        Set the global inset size. This call resets a previous vertical inset size to the new global inset size.
      • setInsetSizeHorizontal

        public void setInsetSizeHorizontal(int size)
        Set the vertical inset size to be used at top and bottom of this panel. Setting the global inset size with setInsetSize(int) at a later stage will overwrite this setting.
        Since:
        JavaView 3.09.002
        Version:
        13.02.04, 1.00 created (kp)
      • setInsetSizeVertical

        public void setInsetSizeVertical(int size)
        Set the vertical inset size to be used at top and bottom of this panel. Setting the global inset size with setInsetSize(int) at a later stage will overwrite this setting.
        Since:
        JavaView 3.09.002
        Version:
        13.02.04, 1.00 created (kp)
      • getTitle

        public java.awt.Label getTitle()
        Get the main title label, or null of no title exists.
        Version:
        07.08.99, 1.00 created (kp)
      • getTitle

        public java.awt.Label getTitle(java.lang.String title)
        Create a new main title label with given string and standard font.
        Since:
        JavaView 3.96.022
        Version:
        17.06.06, 1.00 created (kp)
      • getTitle

        public java.awt.Label getTitle(java.lang.String title,
                                       java.awt.Font font)
        Create a new main title label with given string and font. Font identifier is obtained, for example, from font IDs PsConfig.FONT_HEADER2 via PsConfig.getFont(fontID).
        Since:
        JavaView 3.96.022
        Version:
        17.06.06, 1.00 created (kp)
      • hasTitle

        public boolean hasTitle()
        Check whether panel has a main title label.
      • removeTitle

        public void removeTitle()
        Remove label of panel title from this panel.
        Version:
        28.12.01, 1.00 created (kp)
      • setTitle

        public void setTitle(java.lang.String title)
        Set string of main title of panel but do not add title to panel. For compatibility, the method creates a new title with default font, if not available.
        Version:
        19.10.12, 2.10 revised (kp) Switch back to void return since compatibility issue.
        17.06.06, 2.00 revised (kp) Method now returns the title label.
      • addTitle

        public java.awt.Label addTitle(java.lang.String title)
        Create main title to panel in header font and add to panel.
      • addSubTitle

        public java.awt.Label addSubTitle(java.lang.String title)
        Add subtitle to panel in subheader font and return label. Each invocation of this method will create and add a new subtitle.
      • addLine

        public java.awt.Canvas addLine(int size)
        Add a horizontal line with specified thickness as separator.
        Parameters:
        size - thickness of line
      • addLine

        public java.awt.Canvas addLine(int size,
                                       int orient)
        Add a horizontal line with specified thickness as separator.
        Parameters:
        size - thickness of line
      • addTextField

        public java.awt.TextField addTextField(java.lang.String label,
                                               int length)
        Add a label and textField in a horizontal panel with GridLayout(1, 2). This is a convenient method to reduce the code in inspectors.
        Parameters:
        label - label shown to the left of the text field
        length - length of the text field
        Returns:
        TextField component
      • setText

        public static boolean setText(java.awt.TextComponent widget,
                                      java.lang.String text)
        Update the content of a text field if the new content is different from the current content of the widget. This method is a shortcut and intended to be used in nearly all panels.

        See additional comments in PsPanel#setEnabled(Component, boolean).

        Parameters:
        widget - the gui element which shall be updated
        text - the new text of the text field
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.40
        Version:
        31.03.20, 2.10 revised (kp) Use of java.awt.Component#getPeer() disabled since no longer in Java 9. 21.11.18, 2.01 revised (kp) Using preprocessor directives 1.1 compatible version re-activated to allow built-process, while default setting is Java 9 compatible.
        28.08.18, 2.00 revised (ur) removed deprecated code to achieve Java 9 compatibility.
        31.07.04, 1.50 revised (kp) Superclass changed to TextComponent from TextField.
        23.07.02, 1.00 created (kp)
      • setText

        public static boolean setText(java.awt.Label widget,
                                      java.lang.String text)
        Update the content of a label if the new content is different from the current content of the widget. This method is a shortcut and intended to be used in nearly all panels.

        See additional comments in PsPanel#setEnabled(Component, boolean).

        Parameters:
        widget - the gui element which shall be updated
        text - the new text of the label
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.30
        Version:
        23.07.02, 1.00 created (kp)
      • select

        public static boolean select(java.awt.Choice widget,
                                     int index)
        Update the selected index of a choice if the new index is different from the current selection of the widget. This method is a shortcut and intended to be used in nearly all panels.

        See additional comments in PsPanel#setEnabled(Component, boolean).

        Parameters:
        widget - the gui element which shall be updated
        index - the new selected index of the choice
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.30
        Version:
        23.07.02, 1.00 created (kp)
      • setSelectedCheckbox

        public static boolean setSelectedCheckbox(java.awt.CheckboxGroup widget,
                                                  java.awt.Checkbox checkbox)
        In a checkbox group selected a checkbox if it is different from the current selection of the widget. This method is a shortcut and intended to be used in nearly all panels.

        See additional comments in PsPanel#setEnabled(Component, boolean).

        Parameters:
        widget - the gui element which shall be updated
        checkbox - the new selected checkbox
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.30
        Version:
        23.07.02, 1.00 created (kp)
      • setState

        public static boolean setState(java.awt.Checkbox widget,
                                       boolean bState)
        Assure that a checkbox has same state than corresponding boolean flag. If state of checkbox is equal to the requested new state then do nothing.

        See additional comments in PsPanel#setEnabled(Component, boolean).

        Parameters:
        widget - Checkbox
        bState - Requested new state of the checkbox
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.30
        Version:
        23.07.02, 1.00 created (kp)
      • setLabel

        public static boolean setLabel(java.awt.Button widget,
                                       java.lang.String text)
        Set the label of a button if it is different from the current label. If label of button is equal to the requested new label then do nothing.

        See additional comments in PsPanel#setEnabled(Component, boolean).

        Parameters:
        widget - Button
        text - new label of the widget
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.30
        Version:
        23.07.02, 1.00 created (kp)
      • setLabel

        public static boolean setLabel(java.awt.Checkbox widget,
                                       java.lang.String text)
        Set the label of a checkbox if it is different from the current label. If label of checkbox is equal to the requested new label then do nothing.

        See additional comments in PsPanel#setEnabled(Component, boolean).

        Parameters:
        widget - Checkbox
        text - new label of the widget
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.30
        Version:
        23.07.02, 1.00 created (kp)
      • setEnabled

        public static boolean setEnabled(java.awt.Component widget,
                                         boolean bEnable)
        Assure that a component is enabled if requested. If state of component is equal to the requested new state then do nothing.

        Note: never call one of the static helper methods from an overwritten method with the same name. For example, if MyLabel extends Label and MyLabel#setEnabled(boolean) exists. Then an invocation of PsPanel.setEnabled(this, boolean) in MyLabel#setEnabled would lead to loop since PsPanel.setEnabled calls MyLabel#setEnabled.

        Parameters:
        widget - Component
        bEnable - Requested new state of the component
        Returns:
        true if the value has been update in this method.
        Since:
        JavaView 2.30
        Version:
        23.07.02, 1.00 created (kp)
      • addLabelComponent

        public java.awt.Panel addLabelComponent(java.lang.String label,
                                                java.awt.Component comp)
        Add a label and a component in a horizontal panel with GridLayout(1, 2). This is a convenient method to reduce the code in inspectors.
        Parameters:
        label - text shown to the left of the component
        comp - component shown to the right of the label
        Returns:
        panel showing label and component
      • drawText

        public void drawText(java.awt.Graphics g,
                             java.awt.Point point,
                             java.lang.String string)
        Draw text at specified position.
      • drawBorder

        public static void drawBorder(java.awt.Graphics g,
                                      int borderType,
                                      java.awt.Rectangle rectangle)
        Draw a rectangle into the given graphics context.
        See Also:
        drawBorder(Graphics, int, Rectangle, Color)
        Version:
        02.02.02, 1.00 created (kp)
      • drawBorder

        public static void drawBorder(java.awt.Graphics g,
                                      int borderType,
                                      java.awt.Rectangle rectangle,
                                      java.awt.Color color)
        Draw a rectangle into the given graphics context with given color.
        Since:
        JavaView 2.47
        See Also:
        drawBorder(Graphics, int, Rectangle)
        Version:
        08.12.02, 1.00 created (kp)
      • drawBorder

        public void drawBorder(java.awt.Graphics g,
                               int borderType)
        Draw border around this panel.
      • drawBorder

        public static void drawBorder(java.awt.Component comp,
                                      java.awt.Graphics g,
                                      int borderType)
        Deprecated. use static void PsPanel.drawBorder(Graphics, borderType, Rectangle);
        Draw border around panel. Method calls PsPanel.drawBorder(g, borderType, new Rectangle(comp.getSize()));
      • setBorderType

        public void setBorderType(int borderType)
        Set border of panel which is automatically drawn. If borderType==PsPanel.BORDER_NONE drawing is disabled, otherwise the borderType is set and drawing is enabled.
        Parameters:
        borderType - type of border, for possible values see PsPanel.
        See Also:
        paint(Graphics)
      • setOutOfDate

        public void setOutOfDate(boolean state)
        Mark this panel as being not synchronized with the correct data of its parent. Usually, this method is invoked whenever a parent changes but this panel is temporarily not visible. In this case the next invocation of this paint(Graphics) method will at first update this panel with new data from its parent by calling this.update(m_parent).
        Version:
        21.01.01, 1.00 revised (kp)
        21.01.01, 1.00 created (kp)
      • paint

        public void paint(java.awt.Graphics g)
        Call super.paint(g) and draw border around panel. If this panel is out of date, then this panel is first synchronized with new data from its parent by calling this.update(m_parent).

        If this panel has an image then the image is drawn before super.paint(Graphics) is called.

        Overrides:
        paint in class java.awt.Container
        See Also:
        setBorderType(int)
        Version:
        12.11.06, 1.60 revised (kp) If image exists still clear panel with background color since image may be semi-transparent.
        21.01.01, 1.50 revised (kp) Synchronize with parent if out of date.
        12.11.00, 1.10 revised (kp) Drawing of background image added.
      • update

        public void update(java.awt.Graphics g)
        Override Component.update(Graphics) to avoid clearing the component if an image is available.
        Overrides:
        update in class java.awt.Container
"JavaView? v5.03.003"

"

The software JavaView? is copyright protected. All Rights Reserved.
"

You see the box below because you did not login.