Class ALcyShapeCustomizerPanel

All Implemented Interfaces:
ILcdUndoableSource, ILcyCustomizerPanel, ILcdPropertyChangeSource, ImageObserver, MenuContainer, Serializable, Accessible

public abstract class ALcyShapeCustomizerPanel extends ALcyCustomizerPanel

Abstract class that facilitates the implementation of ILcyCustomizerPanel for shapes. This class can only be used to edit instances of TLcyShapeContext.

Since:
8.2
See Also:
  • Constructor Details

  • Method Details

    • getView

      protected ILcdView getView()
      Convenience method to return the ILcdView that was set by setting a TLcyShapeContext using setObject.
      Returns:
      Null if no TLcyShapeContext is set, the ILcdView related to that context object otherwise.
    • getLayer

      protected ILcdLayer getLayer()
      Convenience method to return the ILcdLayer that was set by setting a TLcyShapeContext using setObject.
      Returns:
      Null if no TLcyShapeContext is set, the ILcdLayer related to that context object otherwise.
    • getModel

      protected ILcdModel getModel()
      Convenience method to return the ILcdModel that was set by setting a TLcyShapeContext using setObject.
      Returns:
      Null if no TLcyShapeContext is set, the ILcdModel related to that context object otherwise.
    • getShape

      protected ILcdShape getShape()
      Convenience method to return the geometry (e.g. polyline) that was set by setting a TLcyShapeContext using setObject.
      Returns:
      Null if no TLcyShapeContext object is set, the geometry (e.g., polyline) related to that context object otherwise.
    • canSetObject

      public boolean canSetObject(Object aObject)
      Description copied from class: ALcyCustomizerPanel
      Returns true if and only if setObject would not throw an IllegalArgumentException.

      Only accepts null or objects that pass the object filter. If the filter itself is null, all objects are accepted.

      Specified by:
      canSetObject in interface ILcyCustomizerPanel
      Overrides:
      canSetObject in class ALcyCustomizerPanel
      Parameters:
      aObject - The object to check.
      Returns:
      true if setObject would accept the object, false if it would throw an exception.
    • getShapeContext

      protected final TLcyShapeContext getShapeContext()

      Returns the TLcyShapeContext object that was set on this customizer. This context object can be used to retrieve the geometry, layer and view in which the geometry is shown.

      Returns:
      The set TLcyShapeContext. This object can be null when this customizer was deinitialized (with setObject(null)).
    • updateCustomizerPanelFromObject

      protected void updateCustomizerPanelFromObject()

      Calls updateCustomizerPanelFromObject( isPanelEditable() ).

      Updates the user interface state according to the current state of the set Object. This method is called whenever a new object is set using setObject, or when the changes are canceled using cancelChanges.

      It does not need to take care of "changesPending".

      Consider for example that a TLcyLayerContext is set and a new label text is entered in a text field. When this method is called, the new label text should be cleared and the original label of the ILcdLayer (getLabel()) should be put in the text field.

      Specified by:
      updateCustomizerPanelFromObject in class ALcyCustomizerPanel
    • updateCustomizerPanelFromObject

      protected abstract void updateCustomizerPanelFromObject(boolean aPanelEditable)
      This means updating the user interface state according to the current state of the set TLcyShapeContext. This method is called whenever a new object is set using setObject, or when the changes are canceled using cancelChanges.

      It does not need to take care of "changesPending".

      Consider for example that a TLcyShapeContext is set and a new label text is entered in a text field. When this method is called, the new label text should be cleared and the original label of the ILcdLayer (getLabel()) should be put in the text field.

      Parameters:
      aPanelEditable - true if the panel should be editable, false otherwise. See isPanelEditable() for more information.
    • isPanelEditable

      protected boolean isPanelEditable()
      Returns whether the panel is editable or not. Editable means the values it displays can be modified; for example, the content of a text field can be adapted. Not editable means the values it displays cannot be adapted; for example, a text field should be disabled.

      The default implementation returns

      
         getLayer().isEditableSupported() && getLayer().isEditable()
       
      or true if getLayer() is null.

      Override this method to redefine when the panel is editable or not.

      Returns:
      True if the panel should be editable, false otherwise.