/** * Creates and returns a tree which contains the {@link CommonDockable}s * of this {@link CGrid}. The branches of the tree are put in a way, that * the boundaries of the {@link CommonDockable}s are respected as good * as possible. * @return the contents of this grid as tree */ public DockableSplitDockTree toTree(){ return grid.toTree(); }
/** * Informs this grid about a horizontal divider that should be inserted * into the layout. There are no guarantees that the divider really is inserted. * @param x1 the first x coordinate of the divider * @param x2 the second x coordinate of the divider * @param y the y coordinate of the divider */ public void addHorizontalDivider( double x1, double x2, double y ){ grid.addHorizontalDivider( x1, x2, y ); }
/** * Adds some placeholders to this {@link CGrid}. This method does not make any checks concerning * the validity of the placeholders, the placeholders will however be checked once the {@link CGrid} * is deployed.<br> * Please note that placeholders are always placed after the real existing {@link CDockable}s, if * order is important then clients must use a {@link CControlPerspective} to create the layout. * @param x the x-coordinate of the dockables * @param y the y-coordinate of the dockables * @param width the width of the dockables * @param height the height of the dockables * @param placeholders the list of new placeholders */ public void addPlaceholders( double x, double y, double width, double height, Path... placeholders ){ grid.addPlaceholders( x, y, width, height, placeholders ); }
/** * Converts the current grid into a tree. * @return the tree which represents this grid * @see SplitDockStation#dropTree(SplitDockTree) */ public DockableSplitDockTree toTree(){ DockableSplitDockTree tree = new DockableSplitDockTree(); fillTree( tree ); return tree; } }
/** * Informs this grid about a vertical divider that should be inserted * into the layout. There are no guarantees that the divider really is inserted. * @param x the x coordinate of the divider * @param y1 the first y coordinate of the divider * @param y2 the second y coordinate of the divider */ public void addVerticalDivider( double x, double y1, double y2 ){ grid.addVerticalDivider( x, y1, y2 ); } }
/** * Marks <code>dockable</code> as being selected in the stack that * has the boundaries of <code>x, y, width, height</code>. * @param x the x coordinate of the stack * @param y the y coordinate of the stack * @param width the width of the stack * @param height the height of the stack * @param dockable the element to select, not <code>null</code> * @throws IllegalArgumentException if <code>dockable</code> is not registered at location <code>x/y/width/height</code> */ public void select( double x, double y, double width, double height, CDockable dockable ){ grid.setSelected( x, y, width, height, dockable.intern() ); }
/** * Adds a new set of {@link CDockable}s to this grid. The {@link CDockable}s * are also added to the {@link CControl} of this <code>CGrid</code>. * @param x the x-coordinate of the dockables * @param y the y-coordinate of the dockables * @param width the width of the dockables * @param height the height of the dockables * @param dockables a list of {@link SingleCDockable}s and {@link MultipleCDockable}s. */ public void add( double x, double y, double width, double height, CDockable... dockables ){ Dockable[] intern = new Dockable[ dockables.length ]; for( int i = 0; i < intern.length; i++ ){ CDockable dockable = dockables[i]; if( control != null ){ if( dockable instanceof SingleCDockable ){ control.addDockable( (SingleCDockable)dockable ); } else if( dockable instanceof MultipleCDockable ){ if( dockable.getControl() == null ){ control.addDockable( (MultipleCDockable)dockable ); } } } intern[i] = dockable.intern(); } grid.addDockable( x, y, width, height, intern ); }
/** * Converts the current grid into a tree. * @return the tree which represents this grid * @see SplitDockStation#dropTree(SplitDockTree) */ public DockableSplitDockTree toTree(){ DockableSplitDockTree tree = new DockableSplitDockTree(); fillTree( tree ); return tree; } }
/** * Informs this grid about a vertical divider that should be inserted * into the layout. There are no guarantees that the divider really is inserted. * @param x the x coordinate of the divider * @param y1 the first y coordinate of the divider * @param y2 the second y coordinate of the divider */ public void addVerticalDivider( double x, double y1, double y2 ){ grid.addVerticalDivider( x, y1, y2 ); } }
/** * Marks <code>dockable</code> as beeing selected in the stack that * has the boundaries of <code>x, y, width, height</code>. * @param x the x coordinate of the stack * @param y the y coordinate of the stack * @param width the width of the stack * @param height the height of the stack * @param dockable the element to select, not <code>null</code> * @throws IllegalArgumentException if <code>dockable</code> is not registered at location <code>x/y/width/height</code> */ public void select( double x, double y, double width, double height, CDockable dockable ){ grid.setSelected( x, y, width, height, dockable.intern() ); }
/** * Adds a new set of {@link CDockable}s to this grid. The {@link CDockable}s * are also added to the {@link CControl} of this <code>CGrid</code>. * @param x the x-coordinate of the dockables * @param y the y-coordinate of the dockables * @param width the width of the dockables * @param height the height of the dockables * @param dockables a list of {@link SingleCDockable}s and {@link MultipleCDockable}s. */ public void add( double x, double y, double width, double height, CDockable... dockables ){ Dockable[] intern = new Dockable[ dockables.length ]; for( int i = 0; i < intern.length; i++ ){ CDockable dockable = dockables[i]; if( control != null ){ if( dockable instanceof SingleCDockable ){ control.addDockable( (SingleCDockable)dockable ); } else if( dockable instanceof MultipleCDockable ){ if( dockable.getControl() == null ){ control.addDockable( (MultipleCDockable)dockable ); } } } intern[i] = dockable.intern(); } grid.addDockable( x, y, width, height, intern ); }
/** * Creates and returns a tree which contains the {@link CommonDockable}s * of this {@link CGrid}. The branches of the tree are put in a way, that * the boundaries of the {@link CommonDockable}s are respected as good * as possible. * @return the contents of this grid as tree */ public DockableSplitDockTree toTree(){ return grid.toTree(); }
/** * Informs this grid about a horizontal divider that should be inserted * into the layout. There are no guarantees that the divider really is inserted. * @param x1 the first x coordinate of the divider * @param x2 the second x coordinate of the divider * @param y the y coordinate of the divider */ public void addHorizontalDivider( double x1, double x2, double y ){ grid.addHorizontalDivider( x1, x2, y ); }
/** * Adds some placeholders to this {@link CGrid}. This method does not make any checks concerning * the validity of the placeholders, the placeholders will however be checked once the {@link CGrid} * is deployed.<br> * Please note that placeholders are always placed after the real existing {@link CDockable}s, if * order is important then clients must use a {@link CControlPerspective} to create the layout. * @param x the x-coordinate of the dockables * @param y the y-coordinate of the dockables * @param width the width of the dockables * @param height the height of the dockables * @param placeholders the list of new placeholders */ public void addPlaceholders( double x, double y, double width, double height, Path... placeholders ){ grid.addPlaceholders( x, y, width, height, placeholders ); }
/** * Copies the layout of <code>grid</code>. Any changes to <code>grid</code> * afterwards will not affect this station, nor will changes on this station * affect <code>grid</code>. * @param grid the layout to drop, not <code>null</code> * @see #dropTree(SplitDockTree) */ public void dropGrid( SplitDockGrid grid ){ dropTree( grid.toTree() ); }
/** * Copies the layout of <code>grid</code>. Any changes to <code>grid</code> * afterwards will not affect this station, nor will changes on this station * affect <code>grid</code>. * @param grid the layout to drop, not <code>null</code> * @see #dropTree(SplitDockTree) */ public void dropGrid( SplitDockGrid grid ){ dropTree( grid.toTree() ); }