Class Gripper

All Implemented Interfaces:
Alignable, DraggableHandle, ImageObserver, MenuContainer, Serializable, UIResource, SwingConstants

public class Gripper extends JComponent implements SwingConstants, Alignable, DraggableHandle, UIResource
Gripper is a component that you can drag. Actually the component itself doesn't allow you to drag, it is up to the component who uses this Gripper to add mouse motion listener and do the dragging. The Gripper will paint itself so that user can tell immediately that it is something draggable.
See Also:
  • Field Details

  • Constructor Details

    • Gripper

      public Gripper()
      Creates a new horizontal separator.
    • Gripper

      public Gripper(int orientation)
      Creates a new separator with the specified horizontal or vertical orientation.
      Parameters:
      orientation - an integer specifying SwingConstants.HORIZONTAL or SwingConstants.VERTICAL
      Throws:
      IllegalArgumentException - if orientation is neither SwingConstants.HORIZONTAL nor SwingConstants.VERTICAL
  • Method Details

    • getUI

      public GripperUI getUI()
      Returns the Linvalid input: '&F' object that renders this component.
      Overrides:
      getUI in class JComponent
      Returns:
      the SeparatorUI object that renders this component
    • updateUI

      public void updateUI()
      Resets the UI property to a value from the current look and feel.
      Overrides:
      updateUI in class JComponent
      See Also:
    • getUIClassID

      public String getUIClassID()
      Returns the name of the Linvalid input: '&F' class that renders this component.
      Overrides:
      getUIClassID in class JComponent
      Returns:
      the string "GripperUI"
      See Also:
    • supportVerticalOrientation

      public boolean supportVerticalOrientation()
      return true if it supports vertical orientation.
      Specified by:
      supportVerticalOrientation in interface Alignable
      Returns:
      true if it supports vertical orientation
    • supportHorizontalOrientation

      public boolean supportHorizontalOrientation()
      return true if it supports horizontal orientation.
      Specified by:
      supportHorizontalOrientation in interface Alignable
      Returns:
      true if it supports horizontal orientation
    • setOrientation

      public void setOrientation(int orientation)
      Changes the orientation.
      Specified by:
      setOrientation in interface Alignable
      Parameters:
      orientation - the new orientation.
    • getOrientation

      public int getOrientation()
      Gets the orientation.
      Specified by:
      getOrientation in interface Alignable
      Returns:
      orientation
    • getCursor

      public Cursor getCursor()
      Gets the cursor set in the component. If the component does not have a cursor set, the cursor of its parent is returned. If no cursor is set in the entire hierarchy, Cursor.DEFAULT_CURSOR is returned.
      Overrides:
      getCursor in class Component
      Since:
      JDK1.1
      See Also:
    • isRolloverEnabled

      public boolean isRolloverEnabled()
      Gets the rolloverEnabled property.
      Returns:
      the value of the rolloverEnabled property
      See Also:
    • setRolloverEnabled

      public void setRolloverEnabled(boolean b)
      Sets the rolloverEnabled property, which must be true for rollover effects to occur. The default value for the rolloverEnabled property is false. Some look and feels might not implement rollover effects; they will ignore this property.
      Parameters:
      b - if true, rollover effects should be painted
      See Also:
    • isRollover

      public boolean isRollover()
    • setRollover

      public void setRollover(boolean rollover)
    • isSelected

      public boolean isSelected()
    • setSelected

      public void setSelected(boolean selected)