public JideSplitPaneLayout(Container target, int axis, int gap) { super(target, axis, gap); setResetWhenInvalidate(false); }
@SuppressWarnings({"RedundantCast"}) int setDividerLocation(int index, int location, boolean isOriginator) { int oldLocation = getDividerLocation(index); if (oldLocation == -1 || oldLocation == location) return -1; while (nextIndex >= 0 && !isPaneVisible(nextIndex)) { nextIndex -= 2; nextDividerIndex --; while (prevIndex < _componentSizes.length && !isPaneVisible(prevIndex)) { prevIndex += 2; prevDividerIndex ++; (getConstraintMap().get(_target.getComponent(flexibleNextIndex)) == JideBoxLayout.FIX || !isPaneVisible(flexibleNextIndex))) { flexibleNextIndex -= 2; (getConstraintMap().get(_target.getComponent(flexiblePrevIndex)) == JideBoxLayout.FIX || !isPaneVisible(flexiblePrevIndex))) { flexiblePrevIndex += 2; while (nextIndex < _componentSizes.length && !isPaneVisible(nextIndex)) { nextIndex += 2; nextDividerIndex ++; while (prevIndex >= 0 && !isPaneVisible(prevIndex)) { prevIndex -= 2; prevDividerIndex --; (getConstraintMap().get(_target.getComponent(flexibleNextIndex)) == JideBoxLayout.FIX || !isPaneVisible(flexibleNextIndex))) { flexibleNextIndex += 2;
layoutManager = new JideSplitPaneLayout(this, JideSplitPaneLayout.X_AXIS); layoutManager = new JideSplitPaneLayout(this, JideSplitPaneLayout.Y_AXIS); Map<Component,Object> constraintMap = null; if (oldManager instanceof JideSplitPaneLayout) { constraintMap = ((JideSplitPaneLayout) oldManager).getConstraintMap(); layoutManager.addLayoutComponent(comp, constraintMap.get(comp));
/** * Get the divider location. You can only get a valid divider location when the component is displayed on the * screen. If the component has never been displayed on screen, -1 will be returned. * * @param dividerIndex the divider index * @return the location of the divider. */ public int getDividerLocation(int dividerIndex) { return ((JideSplitPaneLayout) getLayout()).getDividerLocation(dividerIndex); }
/** * Uses the component sizes to generate a new array of proportions, and replaces the existing one. */ private void replaceProportions() { ((JideSplitPane) _target).setProportions(deduceProportions()); }
/** * Creates a new <code>JideSplitPane</code> configured with the specified orientation. * * @param newOrientation <code>JideSplitPane.HORIZONTAL_SPLIT</code> or <code>JideSplitPane.VERTICAL_SPLIT</code> * @throws IllegalArgumentException if <code>orientation</code> is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT. */ public JideSplitPane(int newOrientation) { super(); _orientation = newOrientation; if (_orientation != HORIZONTAL_SPLIT && _orientation != VERTICAL_SPLIT) throw new IllegalArgumentException("cannot create JideSplitPane, " + "orientation must be one of " + "JideSplitPane.HORIZONTAL_SPLIT " + "or JideSplitPane.VERTICAL_SPLIT"); // setup layout LayoutManager layoutManager; if (_orientation == HORIZONTAL_SPLIT) { layoutManager = new JideSplitPaneLayout(this, JideSplitPaneLayout.X_AXIS); } else { layoutManager = new JideSplitPaneLayout(this, JideSplitPaneLayout.Y_AXIS); } super.setLayout(layoutManager); setOpaque(false); // setup listener installListeners(); }
/** * Set the divider location. You can only call this method to set the divider location when the component is * rendered on the screen. If the component has never been displayed before, this method call has no effect. * * @param dividerIndex the divider index, starting from 0 for the first divider. * @param location new location */ public void setDividerLocation(int dividerIndex, int location) { ((JideSplitPaneLayout) getLayout()).setDividerLocation(dividerIndex, location, true); validate(); }
/** * Causes this container to lay out its components. Most programs should not call this method directly, but should * invoke the <code>validate</code> method instead. * * @see LayoutManager#layoutContainer * @see #setLayout * @see #validate * @since JDK1.1 */ @Override public void doLayout() { if (removeExtraDividers()) { ((JideSplitPaneLayout) getLayout()).invalidateLayout(this); } super.doLayout(); }
public JideSplitPaneLayout(Container target) { super(target); setResetWhenInvalidate(false); }
public JideSplitPaneLayout(Container target, int axis) { super(target, axis); setResetWhenInvalidate(false); }