Klasse Row<P extends Row<?,?,?>, C extends Row<?,?,?>, A extends Activity>

java.lang.Object
com.flexganttfx.model.Row<P,C,A>
Typparameter:
P - the type of the parent row (example: row is of type "Building" and parent type is "Factory" to express that the factory consists of several buildings).
C - the type of the children rows (example: row is of type "Building" and children type is "Machine" to express that the building houses several machines).
A - the type of the activities shown in this row (example: row is of type "Building", activities are "ProductionOrders" that are executed in this building).

public abstract class Row<P extends Row<?,?,?>, C extends Row<?,?,?>, A extends Activity> extends Object
A row object is used to store the activities found on a row of the Gantt chart. These activities are not stored directly on the row but in an activity repository (see getRepository()). The default repository is of type IntervalTreeActivityRepository and can be replaced by calling setRepository(ActivityRepository). Activities can be placed on lines within the row. The row delegates this work to a LinesManager. The default manager is of type EqualLinesManager. To replace the manager simply call setLinesManager(LinesManager).

Code Example

 public class Aircraft extends Row<Fleet, CrewMember, Flight> {
 }
 
This now allows you to call:
 Aircraft aircraft = new Aircraft();
 ...
 Fleet fleet = aircraft.getParent();
 List<CrewMember> crew = aircraft.getChildren();
 

Lazy Loading

Simply override the isLeaf() method to control whether a row is a parent row or not. Then listen to changes of the expanded property to load the children when the user toggles the expansion state.

 static class HelloLazyRow extends
         Row<HelloLazyRow, HelloLazyRow, Activity> {

     public HelloLazyRow(String name) {
         super(name);

         expandedProperty().addListener(it -> loadChildrenLazily());
     }

     @Override
     public boolean isLeaf() {
         return false;
     }

     private void loadChildrenLazily() {
         getChildren().add(new HelloLazyRow("Child 1"));
         getChildren().add(new HelloLazyRow("Child 2"));
         ...
         getChildren().add(new HelloLazyRow("Child N"));
     }
 }
 
Seit:
1.0
  • Eigenschaftsdetails

  • Felddetails

  • Konstruktordetails

  • Methodendetails

    • getProperties

      public final ObservableMap<Object,Object> getProperties()
      Returns an observable map of properties on this row.
      Gibt zurück:
      an observable map of properties on this row
    • hasProperties

      public final boolean hasProperties()
      Tests if the row has properties.
      Gibt zurück:
      true if node has properties.
    • getParent

      public final P getParent()
      The parent of this row. Each row can have only one parent. If a row has no parent, it represents a root in the tree model.
      Gibt zurück:
      the parent of this row, or null if the row has no parent.
      Seit:
      1.0
    • parentProperty

      public final ReadOnlyObjectProperty<P> parentProperty()
      Returns a read-only property used to store the parent row of this row.
      Gibt zurück:
      the property used for storing the parent row
      Seit:
      1.0
      Siehe auch:
    • getPath

      public final Row[] getPath()
      Returns the path to this row, for example [ROOT, Parent1, Parent2, this].
      Gibt zurück:
      the path to this row
      Seit:
      1.0
    • getChildren

      public final ObservableList<C> getChildren()
      Returns the list of children of this row.
      Gibt zurück:
      the children
      Seit:
      1.0
    • hasChildren

      public boolean hasChildren(Predicate predicate)
      Checks whether the given row has any child rows (no matter how deep) that fulfill the given predicate.
      Parameter:
      predicate - the test to perform
      Gibt zurück:
      true if the row has any children where the predicate returns true
    • isLeaf

      public boolean isLeaf()
      A row is a leaf in the tree table view on the left-hand side of the Gantt chart if it has no children. This method may of course be overridden by subclasses to support alternate means of defining how a row may be a leaf, but the general premise is the same: a leaf can not be expanded by the user, and as such will not show a disclosure node or respond to expansion requests.
      Gibt zurück:
      true if the row is a leaf (has no children rows)
      Seit:
      1.3
    • leafProperty

      public final ReadOnlyBooleanProperty leafProperty()
      Represents the TreeItem leaf property, which is true if the TreeItem has no children.
      Gibt zurück:
      a property for determining if the row is a leaf row
      Seit:
      1.3
      Siehe auch:
    • expandedProperty

      public final BooleanProperty expandedProperty()
      The property used to store the expansion state of the row. The value of this property is needed for controlling the state of the tree items that will be created for the tree table view control on the left-hand side of the Gantt chart.
      Gibt zurück:
      the expanded property
      Seit:
      1.0
      Siehe auch:
    • setExpanded

      public final void setExpanded(boolean expanded)
      Sets the value of the expandedProperty().
      Parameter:
      expanded - the new value of the expanded property
      Seit:
      1.0
    • isExpanded

      public final boolean isExpanded()
      Returns the value of the expandedProperty().
      Gibt zurück:
      true if the row is expanded
      Seit:
      1.0
    • showingProperty

      public final ReadOnlyBooleanProperty showingProperty()
      The property used to express whether a row is currently showing in the view or not. This information can be useful when deciding whether a row needs to update its activities or not, for example in a lazy-loading scenario.
      Gibt zurück:
      the showing property
      Seit:
      1.0
      Siehe auch:
    • isShowing

      public final boolean isShowing()
      Returns the value of showingProperty().
      Gibt zurück:
      true if the row is currently showing in the UI
      Seit:
      1.0
    • layoutProperty

      public final ObjectProperty<Layout> layoutProperty()
      The property used to store the layout used for laying out the activities that are directly associated with the row (and not on an inner line).
      Gibt zurück:
      the row layer property
      Seit:
      1.0
      Siehe auch:
    • getLayout

      public final Layout getLayout()
      Returns the value of the layoutProperty().
      Gibt zurück:
      the layout of the row
      Seit:
      1.0
    • setLayout

      public final void setLayout(Layout layout)
      Sets the value of the layoutProperty().
      Parameter:
      layout - the new row layout
      Seit:
      1.0
    • repositoryProperty

      public final ObjectProperty<ActivityRepository<A>> repositoryProperty()
      The property used to store the activity repository for the row. A repository is used to lookup the activities for a given time interval that needs to be shown on the row.
      Gibt zurück:
      the repository property
      Seit:
      1.0
      Siehe auch:
    • getRepository

      public final ActivityRepository<A> getRepository()
      Returns the value of the repositoryProperty().
      Gibt zurück:
      the activity repository of the row
      Seit:
      1.0
    • setRepository

      public final void setRepository(ActivityRepository<A> repository)
      Sets the value of the repositoryProperty().
      Parameter:
      repository - the new repository to use
      Seit:
      1.0
    • getEarliestTimeUsed

      public final Instant getEarliestTimeUsed()
      Returns the earliest time used by the row. This is a convenience method delegating to ActivityRepository.getEarliestTimeUsed().
      Gibt zurück:
      the earliest time used by the row / by the activities of the row / earliest start time of any activity on the row
      Seit:
      getLatestTimeUsed(), 1.0
    • getLatestTimeUsed

      public final Instant getLatestTimeUsed()
      Returns the latest time used by the row. This is a convenience method delegating to ActivityRepository.getLatestTimeUsed().
      Gibt zurück:
      the latest time used by the row / by the activities of the row / earliest start time of any activity on the row
      Seit:
      getEarliestTimeUsed(), 1.0
    • nameProperty

      public final StringProperty nameProperty()
      The property used to store the name of the row.
      Gibt zurück:
      the name property
      Seit:
      1.0
      Siehe auch:
    • getName

      public final String getName()
      Returns the value of the nameProperty().
      Gibt zurück:
      the name of the row
      Seit:
      1.0
    • setName

      public final void setName(String name)
      Sets the value of the nameProperty().
      Parameter:
      name - the new name of the row
      Seit:
      1.0
    • heightProperty

      public final DoubleProperty heightProperty()
      The property used to store the height of the row.
      Gibt zurück:
      the row height property
      Seit:
      1.0
      Siehe auch:
    • setHeight

      public final void setHeight(double height)
      Sets the value of the heightProperty().
      Parameter:
      height - the new height of the row
      Seit:
      1.0
    • getHeight

      public final double getHeight()
      Returns the value of the heightProperty().
      Gibt zurück:
      the value of the height property
      Seit:
      1.0
    • minHeightProperty

      public final DoubleProperty minHeightProperty()
      The property used to store the minimum height of the row. The user will not be able to resize the row to anything smaller than the value of this property.
      Gibt zurück:
      the minimum height property
      Seit:
      1.0
      Siehe auch:
    • setMinHeight

      public final void setMinHeight(double height)
      Sets a new value for the minHeightProperty().
      Parameter:
      height - the new minimum height
      Seit:
      1.0
    • getMinHeight

      public final double getMinHeight()
      Returns the value of the minHeightProperty().
      Gibt zurück:
      the minimum height of the row
      Seit:
      1.0
    • maxHeightProperty

      public final DoubleProperty maxHeightProperty()
      The property used to store the maximum height of the row. The user will not be able to resize the row to anything larger than the value of this property.
      Gibt zurück:
      the maximum height property
      Seit:
      1.0
      Siehe auch:
    • setMaxHeight

      public final void setMaxHeight(double height)
      Sets the value of the maxHeightProperty().
      Parameter:
      height - the maximum height of the row
      Seit:
      1.0
    • getMaxHeight

      public final double getMaxHeight()
      Returns the value of maxHeightProperty().
      Gibt zurück:
      the maximum height of the row
      Seit:
      1.0
    • userObjectProperty

      public final ObjectProperty<Object> userObjectProperty()
      The property used to store a row-specific user object.
      Gibt zurück:
      the user object property
      Seit:
      1.0
      Siehe auch:
    • getUserObject

      public final Object getUserObject()
      Returns the value of userObjectProperty().
      Gibt zurück:
      the user object associated with this row
      Seit:
      1.0
    • setUserObject

      public final void setUserObject(Object obj)
      Sets the value of userObjectProperty().
      Parameter:
      obj - the new user object
      Seit:
      1.0
    • linesManagerProperty

      public final ObjectProperty<LinesManager<A>> linesManagerProperty()
      The property used to store the LinesManager instance for this row. The lines manager is used to control the layout of inner lines and the placement of activities on these lines.
      Gibt zurück:
      the lines manager property
      Seit:
      1.0
      Siehe auch:
    • getLinesManager

      public final LinesManager<A> getLinesManager()
      Returns the value of linesManagerProperty().
      Gibt zurück:
      the lines manager for this row
      Seit:
      1.0
    • setLinesManager

      public final void setLinesManager(LinesManager<A> manager)
      Sets the value of linesManagerProperty().
      Parameter:
      manager - the new lines manager
      Seit:
      1.0
    • zoneIdProperty

      public final ObjectProperty<ZoneId> zoneIdProperty()
      The property used to store the zone ID for this row. Each row can be placed in a different time zone.
      Gibt zurück:
      the zone ID property
      Seit:
      1.0
      Siehe auch:
    • getZoneId

      public final ZoneId getZoneId()
      Returns the value of the zoneIdProperty().
      Gibt zurück:
      the zone ID of this row
      Seit:
      1.0
    • setZoneId

      public final void setZoneId(ZoneId zoneId)
      Sets the value of the zoneIdProperty().
      Parameter:
      zoneId - the new zone ID for this row
      Seit:
      1.0
    • getCalendars

      public final ObservableList<Calendar<?>> getCalendars()
      Returns a list of calendars attached to this row. Calendars directly attached to a row can be used to visualize row-specific information, for example "resource availability".
      Gibt zurück:
      a list of row-specific calendars
      Seit:
      1.0
    • lineCountProperty

      public final IntegerProperty lineCountProperty()
      The property used to keep track of the number of inner lines shown by the row.
      Gibt zurück:
      the line count property
      Seit:
      1.0
      Siehe auch:
    • setLineCount

      public final void setLineCount(int count)
      Sets the value of the lineCountProperty().
      Parameter:
      count - the new line count for the row
      Seit:
      1.0
    • getLineCount

      public final int getLineCount()
      Returns the value of the lineCountProperty().
      Gibt zurück:
      the line count of the row
      Seit:
      1.0
    • addActivity

      public final void addActivity(Layer layer, A activity)
      Adds the given activity for the given layer to this row. This method delegates to MutableActivityRepository.addActivity(ActivityRef).
      Parameter:
      layer - the layer where the activity will be displayed
      activity - the activity that will be added
      Seit:
      1.0
      Siehe auch:
    • removeActivity

      public final void removeActivity(Layer layer, A activity)
      Removes the given activity from the given layer from this row.
      Parameter:
      layer - the layer from which to remove the activity
      activity - the activity to remove
      Seit:
      1.0
      Siehe auch:
    • clearActivities

      public final void clearActivities()
      Removes all activities from the row.
      Seit:
      1.0
      Siehe auch:
    • clearActivities

      public final void clearActivities(Layer layer)
      Removes all activities on the given layer from the row.
      Parameter:
      layer - the layer from which to remove all activities
      Seit:
      1.0
      Siehe auch:
    • getLineIndex

      public final int getLineIndex(A activity)
      Returns the line index for the given activity. This is a convenience method delegating to LinesManager.getLineIndex(Activity).
      Parameter:
      activity - the activity for which to return a line index
      Gibt zurück:
      the line index for the given activity
      Seit:
      1.0
    • getLineLocation

      public final double getLineLocation(int lineIndex)
      Returns the location of the given inner line. The value returned is usually between 0 and getHeight().
      Parameter:
      lineIndex - the index of the line for which to return a location
      Gibt zurück:
      the line location y-coordinate
      Seit:
      1.0
    • getLineHeight

      public final double getLineHeight(int lineIndex)
      Returns the height of the given inner line. The value returned is usually between 0 and getHeight().
      Parameter:
      lineIndex - the index of the line for which to return a height
      Gibt zurück:
      the height of the line
      Seit:
      1.0
    • getLineLayout

      public final Layout getLineLayout(int lineIndex)
      Returns a line-specific layout for the given line.
      Parameter:
      lineIndex - the index of the line
      Gibt zurück:
      the line layout
      Seit:
      1.0
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object