Class RJShape

All Implemented Interfaces:
RMArchiver.Archiving, RMShapePainter.Paint, RJMinMaxSizeSettable, Cloneable
Direct Known Subclasses:
JProgressBarShape, JScrollPaneShape, JSeparatorShape, JSliderShape, JSpinnerShape, JSplitPaneShape, JTabbedPaneShape, JTableShape, JTreeShape, RJColorDockShape, RJColorWellShape, RJCustomViewShape, RJPanelShape, RJSwitchPaneShape, RJTextShape, RJThumbWheelShape

public class RJShape extends RMShape implements RMShapePainter.Paint, RJMinMaxSizeSettable
An RMShape subclass to represent Swing components.
  • Constructor Details

    • RJShape

      public RJShape()
      Creates a new RJShape.
    • RJShape

      public RJShape(JComponent aComponent)
      Creates a new RJShape for the given component.
  • Method Details

    • getComponent

      public JComponent getComponent()
      Returns the RJComponent represented by this shape.
    • setComponent

      public void setComponent(JComponent aComponent)
      Sets the RJComponent represented by this shape.
    • getName

      public String getName()
      Returns the shape's component's name.
      Overrides:
      getName in class RMShape
    • setName

      public void setName(String aName)
      Sets the shape's component's name.
      Overrides:
      setName in class RMShape
    • setX

      public void setX(double aValue)
      Overrides shape implementation to propagate to component.
      Overrides:
      setX in class RMShape
    • setY

      public void setY(double aValue)
      Overrides shape implementation to propagate to component.
      Overrides:
      setY in class RMShape
    • setWidth

      public void setWidth(double aValue)
      Overrides shape implementation to propagate to component.
      Overrides:
      setWidth in class RMShape
    • setHeight

      public void setHeight(double aValue)
      Overrides shape implementation to propagate to component.
      Overrides:
      setHeight in class RMShape
    • setFill

      public void setFill(RMFill aFill)
      Overrides shape implementation to propagate to component.
      Overrides:
      setFill in class RMShape
    • getAutosizing

      public String getAutosizing()
      Overrides shape implementation to propagate to component.
      Overrides:
      getAutosizing in class RMShape
    • setAutosizing

      public void setAutosizing(String aValue)
      Overrides shape implementation to propagate to component.
      Overrides:
      setAutosizing in class RMShape
    • setMaximumSize

      public void setMaximumSize(RMSize max)
      Set component's maximum size as an RMSize
      Specified by:
      setMaximumSize in interface RJMinMaxSizeSettable
    • getMaximumSize

      public RMSize getMaximumSize()
      Returns component's maximum size as an RMSize.
      Specified by:
      getMaximumSize in interface RJMinMaxSizeSettable
    • setMinimumSize

      public void setMinimumSize(RMSize min)
      Set component's minimum size as an RMSize.
      Specified by:
      setMinimumSize in interface RJMinMaxSizeSettable
    • getMinimumSize

      public RMSize getMinimumSize()
      Returns component's minimum size as an RMSize.
      Specified by:
      getMinimumSize in interface RJMinMaxSizeSettable
    • getDefaultMinimumSize

      public RMSize getDefaultMinimumSize()
      Get the minimum/maximum size values from the component instead of the helper. If had been set previously, we'll get the last set value, otherwise it will return whatever the component's default is (on this L&F)
      Specified by:
      getDefaultMinimumSize in interface RJMinMaxSizeSettable
    • getDefaultMaximumSize

      public RMSize getDefaultMaximumSize()
      Get the minimum/maximum size values from the component instead of the helper. If had been set previously, we'll get the last set value, otherwise it will return whatever the component's default is (on this L&F)
      Specified by:
      getDefaultMaximumSize in interface RJMinMaxSizeSettable
    • getFont

      public RMFont getFont()
      Overrides shape implementation to propagate to component.
      Overrides:
      getFont in class RMShape
    • setFont

      public void setFont(RMFont aFont)
      Overrides shape implementation to propagate to component.
      Overrides:
      setFont in class RMShape
    • getBorder

      public Border getBorder()
      Returns the Swing border for this shape.
    • setBorder

      public void setBorder(Border aBorder)
      Sets the Swing border for this shape.
    • getToolTipText

      public String getToolTipText()
      Returns the tool tip text associated with this shape's component.
    • setToolTipText

      public void setToolTipText(String aValue)
      Sets the tool tip text associated with this shape's component.
    • getChildRB

      public RJShape getChildRB(int anIndex)
      Returns the individual child at the given index as an RJShape.
    • getBoundsInsideInset

      public RMRect getBoundsInsideInset()
      Returns the bounds of the shape in its own coordinate system, inset by the component's Insets, if it has any.
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class RMShape
    • clone

      public Object clone()
      Standard clone implementation.
      Overrides:
      clone in class RMShape
    • cloneDeep

      public RMShape cloneDeep()
      For clone deep, lets just archive and unarchive component, and get shape hieracrhy from it.
      Overrides:
      cloneDeep in class RMShape
    • getClipRect

      public RMRect getClipRect()
      Implemented by sublasses to specify clipping behavior. Null (the default) indicates no clipping. Any other rect is interpreted as being in the parent's coordinate system.
    • setClipsChildren

      public void setClipsChildren(boolean flag)
      Any shape can be set to clip to its bbox by calling setClipsChildren(true).
    • paintShape

      public void paintShape(RMShapePainter aPainter, Graphics2D g)
      Paints the shape.
      Specified by:
      paintShape in interface RMShapePainter.Paint
    • getImage

      public BufferedImage getImage()
      Returns the image for this shape.
    • recache

      public void recache()
      Resets the image represenation of this control to force it to recreate from component.
    • recacheDeep

      public void recacheDeep()
      Recache the entire shape tree (depth first).
    • paintImage

      public void paintImage(Graphics2D g)
      Paints the shape component image with the given graphics.
    • paintImageOverkill

      public void paintImageOverkill(Graphics2D g)
      Paints the shape component image into the given graphics in a manner more likely to always work.
    • getToolClassName

      public String getToolClassName()
      Editor method - indicates that linked text should use normal text inspector.
      Overrides:
      getToolClassName in class RMShape
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXML in class RMShape
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Overrides:
      fromXML in class RMShape
    • super_fromXML

      public Object super_fromXML(RXArchiver anArchiver, RXElement anElement)
      Provides access to RMShape fromXML implementation.
    • acceptsDrag

      public boolean acceptsDrag(DropTargetDragEvent dragEvent)
      Implemented by shapes that can handle drag & drop
    • dragAtPoint

      public void dragAtPoint(DropTargetDragEvent dragEvent, RMPoint aPoint)
      Editor method - called by RBEditor when system does DnD over shape.
    • dropAtPoint

      public void dropAtPoint(DropTargetDropEvent dropEvent, RMPoint aPoint)
      Editor method.
    • dropKeyAtPoint

      public void dropKeyAtPoint(String aKey, RMPoint aPoint)
      Editor method.
      Overrides:
      dropKeyAtPoint in class RMShape
    • dragExit

      public void dragExit()
      Editor method.
      Overrides:
      dragExit in class RMShape
    • findParentPanel

      public RJPanel findParentPanel()
      Walks up the shape hierarchy looking for the first ancestor of this shape which is an RJPanel.