Documentation of 'kcl.waterloo.swing.layout.GraphUnitLayout' Java class
GraphUnitLayout
kcl.waterloo.swing.layout

Class GraphUnitLayout

  • All Implemented Interfaces:
    java.awt.LayoutManager, java.awt.LayoutManager2
    Direct Known Subclasses:
    GraphContainerLayout, GraphLayout


    public abstract class GraphUnitLayout
    extends javax.swing.SpringLayout
    GraphUnitLayout extends SpringLayout to provide support for components that are positioned in graph coordinate space. Use the putGraphicConstraint method to add components in graph space. Note that the putConstraint method may still be used to position components using pixel coordinates. GraphUnitLayout is an abstract class.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.SpringLayout

        javax.swing.SpringLayout.Constraints
    • Field Summary

      • Fields inherited from class javax.swing.SpringLayout

        BASELINE, EAST, HEIGHT, HORIZONTAL_CENTER, NORTH, SOUTH, VERTICAL_CENTER, WEST, WIDTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      GraphUnitLayout() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void doSuperLayoutContainer(java.awt.Container c)
      This method does nothing and needs to be overridden.
      java.util.LinkedHashMap<java.awt.Component,GraphicConstraint> getComponentMap()
      Returns the LinkedHashMap of Components to be laid out using graph coordinates.
      java.util.ArrayList<java.awt.Dimension> getDimensions()
      Returns an ArrayList of the preferredSize of each component in the componentMap.
      void putGraphicConstraint(java.awt.Component c, double x, double y, int alignX, int alignY)
      Registers the specified component to be laid out using graph units.
      void setComponentMap(java.util.LinkedHashMap<java.awt.Component,GraphicConstraint> map)
      Adds the input to the existing component map.
      void setDimensions(java.util.ArrayList<java.awt.Dimension> dim)
      Sets the dimensions of components in the componentMap.
      • Methods inherited from class javax.swing.SpringLayout

        addLayoutComponent, addLayoutComponent, getConstraint, getConstraints, getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, layoutContainer, maximumLayoutSize, minimumLayoutSize, preferredLayoutSize, putConstraint, putConstraint, removeLayoutComponent
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GraphUnitLayout

        public GraphUnitLayout()
    • Method Detail

      • putGraphicConstraint

        public void putGraphicConstraint(java.awt.Component c,
                                         double x,
                                         double y,
                                         int alignX,
                                         int alignY)
        Registers the specified component to be laid out using graph units.
        Parameters:
        c - the Component
        x - x-position in graph units
        y - y-position in graph units
        alignX - relative X alignment specified using a SwingConstants value.
        alignY - relative Y alignment specified using a SwingConstants value.
      • getComponentMap

        public java.util.LinkedHashMap<java.awt.Component,GraphicConstraint> getComponentMap()
        Returns the LinkedHashMap of Components to be laid out using graph coordinates.
        Returns:
        the LinkedHashMap of Components
      • setComponentMap

        public void setComponentMap(java.util.LinkedHashMap<java.awt.Component,GraphicConstraint> map)
        Adds the input to the existing component map. Entries for components already present will be updated. Entries for components not present in the existing componenMap will be added.
        Parameters:
        map -
      • getDimensions

        public java.util.ArrayList<java.awt.Dimension> getDimensions()
        Returns an ArrayList of the preferredSize of each component in the componentMap. This method will be used in serialization/deserialization to preserve the dimensions of Swing annotations.
        Returns:
        ArrayList of Dimensions
      • setDimensions

        public void setDimensions(java.util.ArrayList<java.awt.Dimension> dim)
        Sets the dimensions of components in the componentMap. The input size must match the componentMap size.This method will be used in serialization/deserialization to preserve the dimensions of Swing annotations.
        Parameters:
        dim - ArrayList of Dimensions
      • doSuperLayoutContainer

        public void doSuperLayoutContainer(java.awt.Container c)
        This method does nothing and needs to be overridden.
        Parameters:
        c -

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.