Package hec.gfx2d

Class G2dSpacer

All Implemented Interfaces:
G2dPointerComponent, G2dToolbarListener, ImageObserver, MenuContainer, Serializable, Accessible

public class G2dSpacer extends G2dComponent implements G2dPointerComponent
Base class for components that belong to a G2dPanel.
See Also:
  • Constructor Details

    • G2dSpacer

      public G2dSpacer(G2dPanel p, Axis ax, int align)
      Default Constructor
  • Method Details

    • paint

      public void paint(Graphics g)
      Description copied from class: G2dComponent
      Paints the contents of the panel.
      Overrides:
      paint in class G2dComponent
    • getPixelSpacing

      public int getPixelSpacing()
    • setPixelSpacing

      public void setPixelSpacing(int spacing)
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • setPreferredSizeProvider

      public void setPreferredSizeProvider(PreferredSizeProvider provider)
      sets the a provider that will provide the preferred size for this component. Value can be null. If the value is null then the preferred size will be computed by this component
      Overrides:
      setPreferredSizeProvider in class G2dComponent
      Parameters:
      provider -
    • getPreferredSizeLocal

      public Dimension getPreferredSizeLocal()
      Internal method that computes the preferred size;
      Overrides:
      getPreferredSizeLocal in class G2dComponent
      Returns:
    • createPopupMenu

      public void createPopupMenu()
      Creates and initialized the internal popupmenu that is displayed when a right click event occurs on this object. The menu is only created once. Once created it is reused.
      Overrides:
      createPopupMenu in class G2dComponent
    • editProperties

      public void editProperties()
      This method is called when it is time to edit the properties of this component. Shows a dialog that allows the user to edit the specific properties.
      Overrides:
      editProperties in class G2dComponent
    • objectPopupMenu

      public boolean objectPopupMenu(LocalPt pt, int modifiers)
      Shows a popup menu at LocalPt pt if that point occurs within the boundaries of this Spacer panel. If the popup menu is displayed then true is returned signaling that this panel accepted the popup menu event. Otherwise false is returned.
      Specified by:
      objectPopupMenu in interface G2dPointerComponent
      Overrides:
      objectPopupMenu in class G2dComponent
      Parameters:
      pt - the point to place the popup menu;
      modifiers - mouse modifiers that were recieved by the mouse adapter that may be usefull here.
      Returns:
      true if the object popup event was accepted and consumed otherwise false.
    • pointerOver

      public void pointerOver(LocalPt pt)
      Description copied from interface: G2dPointerComponent
      Method called when the pointer is over a given point
      Specified by:
      pointerOver in interface G2dPointerComponent
      Overrides:
      pointerOver in class G2dComponent
      Parameters:
      pt - - the point in which the pointer is over
    • objectSelect

      public boolean objectSelect(LocalPt pt, int modifiers)
      Description copied from interface: G2dPointerComponent
      Method called on left mouse click.
      Specified by:
      objectSelect in interface G2dPointerComponent
      Parameters:
      pt - the point to place the popup menu;
      modifiers - mouse modifiers that were recieved by the mouse adapter that may be usefull here.
      Returns:
      true if the object select event was accepted and consumed otherwise false.