Class JSplitPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, FieldReconciler.Reconcilable

public class JSplitPane extends JComponent implements Accessible, FieldReconciler.Reconcilable
Emulator for JSplitPane. See D_jsplitpane.
See Also:
  • Field Details

  • Constructor Details

    • JSplitPane

      public JSplitPane()
    • JSplitPane

      public JSplitPane(int orientation)
    • JSplitPane

      public JSplitPane(int orientation, boolean continuousLayout)
    • JSplitPane

      public JSplitPane(int orientation, Component left, Component right)
    • JSplitPane

      public JSplitPane(int orientation, boolean continuousLayout, Component left, Component right)
  • Method Details

    • reconcileFields

      public final void reconcileFields()
      D_field_write_reconcile repair hook — see JSlider.reconcileFields().
      Specified by:
      reconcileFields in interface FieldReconciler.Reconcilable
    • getOrientation

      public int getOrientation()
    • setOrientation

      public void setOrientation(int orientation)
      The surrogate validates the argument and applies the split; the "orientation" fire has to happen here too. The surrogate's own fire lands on the surrogate's listener list, which a migrator holding a JSplitPane never subscribes to — the two layers fan out independently (D_owed_events).
    • setLeftComponent

      public void setLeftComponent(Component c)
      Set the primary slot occupant. JDK HORIZONTAL_SPLIT reads this as the left child; VERTICAL_SPLIT reads it as the top child. Field-shadows the emulator-side reference, delegates to the surrogate's slot setter, and maintains Container.components via the slot-child seam (D_jsplitpane_slot_tree_shape — JDK tree-shape fidelity, sibling fix to [D_shadow_children_tree_shape](#sub-decision-d35d--shadow-children-populate-containercomponents-for-r7-tree-shape-fidelity)). null clears the slot — the old occupant is detached.
    • setTopComponent

      public void setTopComponent(Component c)
    • getLeftComponent

      public Component getLeftComponent()
    • getTopComponent

      public Component getTopComponent()
    • setRightComponent

      public void setRightComponent(Component c)
    • setBottomComponent

      public void setBottomComponent(Component c)
    • getRightComponent

      public Component getRightComponent()
    • getBottomComponent

      public Component getBottomComponent()
    • addImpl

      protected void addImpl(Component comp, Object constraints, int index)
      JDK JSplitPane.addImpl routes constraint strings (LEFT/RIGHT/TOP/ BOTTOM/DIVIDER) into the slot setters. We mirror that — null constraint with no left yet → left; null constraint with left but no right → right; otherwise drop-and-WARN.

      Per D_jsplitpane_slot_tree_shape the slot setters maintain Container.components via the slot-child seam, so getComponentCount() matches JDK (2 with both slots filled). Vaadin SplitLayout owns the peer DOM placement via setPrimaryComponent / setSecondaryComponent; the AWT-side components list and the Vaadin-side slots are separate edges, both maintained per R_swing_is_truth.

      Overrides:
      addImpl in class Container
    • validateTree

      protected void validateTree()
      Overrides:
      validateTree in class Container
    • setDividerLocation

      public void setDividerLocation(int location)
      Field-shadows the int value, fires "dividerLocation" PCE on change, does NOT touch the peer. Vaadin's splitter is percent-only and we have no container width to translate (R_layouts_close_enough). The surrogate-side setter logs WARN per SD_sjsplitpane; we don't reach for it here — the field round-trip suffices on the emulator path.
    • setDividerLocation

      public void setDividerLocation(double proportional)
      Proportional 0–1 form — forwards to the surrogate (which multiplies by 100 and writes splitter position). Does NOT update the int field shadow (different semantic — JDK's proportional form doesn't pre-compute a pixel value), does NOT fire PCE (no Integer pixels to put in the event, same gap as drag-end PCE).
    • getDividerLocation

      public int getDividerLocation()
    • getLastDividerLocation

      public int getLastDividerLocation()
    • setLastDividerLocation

      public void setLastDividerLocation(int location)
    • getMinimumDividerLocation

      public int getMinimumDividerLocation()
      JDK reads from the UI delegate's pixel coords; we have no such thing (R_layouts_close_enough). Drop-and-WARN, return -1.
    • getMaximumDividerLocation

      public int getMaximumDividerLocation()
    • resetToPreferredSizes

      public void resetToPreferredSizes()
      Best-effort snap-back per R_best_effort_behaviour — forwards to the surrogate which writes splitter position 50/50, AND resets the int field shadow to -1 + fires "dividerLocation" PCE if the prior value was non-sentinel.
    • getResizeWeight

      public double getResizeWeight()
    • setResizeWeight

      public void setResizeWeight(double weight)
      Round-trip the weight on the emulator only — Vaadin SplitLayout has no Java-side flex-weight knob. JLawyer calls setResizeWeight(0.0) on the outer split and 0.45 on the inner one; the values round-trip but don't affect Vaadin's flex distribution.
    • isOneTouchExpandable

      public boolean isOneTouchExpandable()
    • setOneTouchExpandable

      public void setOneTouchExpandable(boolean b)
    • isContinuousLayout

      public boolean isContinuousLayout()
    • setContinuousLayout

      public void setContinuousLayout(boolean b)
    • getDividerSize

      public int getDividerSize()
    • setDividerSize

      public void setDividerSize(int size)
    • getUIClassID

      public String getUIClassID()
      Overrides:
      getUIClassID in class JComponent
    • updateUI

      public void updateUI()
      Overrides:
      updateUI in class JComponent
    • getUI

      public SplitPaneUI getUI()
      Overrides:
      getUI in class JComponent
    • setUI

      public void setUI(SplitPaneUI ui)
    • getAccessibleContext

      public AccessibleContext getAccessibleContext()
      Specified by:
      getAccessibleContext in interface Accessible
      Overrides:
      getAccessibleContext in class Component
    • paramString

      protected String paramString()
      Overrides:
      paramString in class JComponent