Package hec.gfx2d

Class G2dComponent

All Implemented Interfaces:
G2dToolbarListener, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
AxisTics, G2dLabel, G2dSpacer, LegendItem, LegendItemContainer, LegendPanel, LegendPict, TitlePanel, ViewPanel, Viewport, ViewportTextComponent

public class G2dComponent extends JPanel implements G2dToolbarListener
Base class for components that belong to a G2dPanel.
See Also:
  • Field Details

    • LEFT

      public static final int LEFT
      Align tics on the left edge of the component
      See Also:
    • TOP

      public static final int TOP
      Align tics on the top edge of the component
      See Also:
    • BOTTOM

      public static final int BOTTOM
      Align tics on the bottom edge of the component
      See Also:
    • _parent

      protected G2dPanel _parent
      Parent component
    • _popupMenu

      protected JPopupMenu _popupMenu
  • Constructor Details

    • G2dComponent

      public G2dComponent()
      Default Constructor
    • G2dComponent

      public G2dComponent(G2dPanel p)
  • Method Details

    • setG2dPanel

      public void setG2dPanel(G2dPanel p)
    • createPopupMenu

      public void createPopupMenu()
    • getG2dPanel

      public G2dPanel getG2dPanel()
    • setPreferredSizeProvider

      public void setPreferredSizeProvider(PreferredSizeProvider preferredSizeProvider)
    • getPreferredSizeLocal

      public Dimension getPreferredSizeLocal()
    • getPreferredSize

      public final Dimension getPreferredSize()
      Computes preferred size based in tic length and font. Finalized in G2dComponent. All subclasses should override getPreferredSizeLocal to custom compute the PreferredSize;
      Overrides:
      getPreferredSize in class JComponent
      Returns:
    • paint

      public void paint(Graphics g)
      Paints the contents of the panel.
      Overrides:
      paint in class JComponent
    • paintComponent

      protected void paintComponent(Graphics arg0)
      Overrides:
      paintComponent in class JComponent
    • paintGfx

      public void paintGfx()
    • paintGfx

      public void paintGfx(Graphics g)
      Paints the contents of the panel.
    • objectPopupMenu

      public boolean objectPopupMenu(LocalPt pt, int modifiers)
    • pointerOver

      public void pointerOver(LocalPt pt)
    • editProperties

      public void editProperties()
    • getToolTipText

      public String getToolTipText(MouseEvent e)
      Returns a tool tip text for the given mouse location. In this method we loop over the glyphs and see if they have any tool tips. The first one that has one is returned;
      Overrides:
      getToolTipText in class JComponent
    • setMouseAdapter

      public void setMouseAdapter(String className)
      Sets the mouse adapter for the component this is identified by the given String. The component must implement the interface for that specific mouse adapter otherwise the adapter is ignored.
      Specified by:
      setMouseAdapter in interface G2dToolbarListener
      Parameters:
      className -
    • setMouseAdapter

      public G2dMouseAdapter setMouseAdapter(G2dMouseAdapter adapter)
      Sets the mouse adapter for the component to the given mouse adapter. The component must implement the interface for that specific mouse adapter otherwise the adapter is ignored.
      Specified by:
      setMouseAdapter in interface G2dToolbarListener
    • getMouseAdapter

      public G2dMouseAdapter getMouseAdapter()
      Specified by:
      getMouseAdapter in interface G2dToolbarListener
    • getAlignment

      public int getAlignment()