/** * Creates a new node. * @param access access ot the {@link SplitDockStation} * @param id a unique identifier for this node */ protected SpanSplitNode( SplitDockAccess access, long id ){ super( access, id ); createSpans(); }
public void resized(){ node.onSpanResize(); }
@Override public void setBounds( double x, double y, double width, double height, double factorW, double factorH, boolean updateComponentBounds ){ super.setBounds( x, y, width, height, factorW, factorH, updateComponentBounds ); treeChanged = false; }
/** * Creates or re-creates the {@link Span}s used by this {@link Leaf}. This method should not be called * by clients. */ @FrameworkOnly public void createSpans(){ spans = getAccess().getSpanStrategy().createSpans( this ); }
/** * Creates a new {@link Rectangle} within <code>bounds</code>, using * <code>spans</code> to create some insets. * @param bounds the boundaries to shrink * @param node the node to evaluate * @return the smaller boundaries */ public Rectangle modifyBounds( Rectangle bounds, SpanSplitNode node ){ Span[] spans = node.getSpans(); if( spans == null ){ return bounds; } Rectangle copy = new Rectangle( bounds ); int left = spans[LEFT].getSize(); int right = spans[RIGHT].getSize(); int top = spans[TOP].getSize(); int bottom = spans[BOTTOM].getSize(); copy.x += left; copy.width -= left + right; copy.y += top; copy.height -= top + bottom; return copy; } }
@Override public void updateBounds( double x, double y, double width, double height, double factorW, double factorH, boolean components ) { super.updateBounds( x, y, width, height, factorW, factorH, components ); if( components ){ resetDisplayerBounds(); } }
/** * Creates or re-creates the {@link Span}s used by this {@link Leaf}. This method should not be called * by clients. */ @FrameworkOnly public void createSpans(){ spans = getAccess().getSpanStrategy().createSpans( this ); }
/** * Creates a new {@link Rectangle} within <code>bounds</code>, using * <code>spans</code> to create some insets. * @param bounds the boundaries to shrink * @param node the node to evaluate * @return the smaller boundaries */ public Rectangle modifyBounds( Rectangle bounds, SpanSplitNode node ){ Span[] spans = node.getSpans(); if( spans == null ){ return bounds; } Rectangle copy = new Rectangle( bounds ); int left = spans[LEFT].getSize(); int right = spans[RIGHT].getSize(); int top = spans[TOP].getSize(); int bottom = spans[BOTTOM].getSize(); copy.x += left; copy.width -= left + right; copy.y += top; copy.height -= top + bottom; return copy; } }
@Override public void updateBounds( double x, double y, double width, double height, double factorW, double factorH, boolean components ) { super.updateBounds( x, y, width, height, factorW, factorH, components ); if( child != null ){ Rectangle bounds = new Rectangle( (int)(x * factorW), (int)(y * factorH), (int)(width * factorW), (int)(height * factorH)); Rectangle refitted = getAccess().getSpanStrategy().modifyBounds( bounds, this ); if( !bounds.equals( refitted ) && factorW > 0 && factorH > 0 ){ x = refitted.x / factorW; y = refitted.y / factorH; width = refitted.width / factorW; height = refitted.height / factorH; } child.updateBounds( x, y, width, height, factorW, factorH, components ); } treeChanged = false; }
/** * Creates a new node. * @param access access ot the {@link SplitDockStation} * @param id a unique identifier for this node */ protected SpanSplitNode( SplitDockAccess access, long id ){ super( access, id ); createSpans(); }
public void resized(){ node.onSpanResize(); }
@Override public void setBounds( double x, double y, double width, double height, double factorW, double factorH, boolean updateComponentBounds ){ super.setBounds( x, y, width, height, factorW, factorH, updateComponentBounds ); if( updateComponentBounds ){ resetDisplayerBounds(); } }