private void initComponents() { setLayout(new BorderLayout()); final JPanel containerPanel = new JPanel(); containerPanel.setLayout(new BorderLayout()); theRendererContext = new SimpleHtmlRendererContext(theSheetPanel); theDocBuilder = new DocumentBuilderImpl(theRendererContext.getUserAgentContext(), theRendererContext); theSheetPanel = new HtmlPanel(); containerPanel.add(theSheetPanel, BorderLayout.CENTER); theSelectPanel = new SelectPanel(this); theSplitPane = new FlippingSplitPane(JSplitPane.HORIZONTAL_SPLIT, containerPanel, theSelectPanel); theSplitPane.setOneTouchExpandable(true); theSplitPane.setDividerSize(10); add(theSplitPane, BorderLayout.CENTER); theSheetPanel.setPreferredWidth(this.getWidth()); addComponentListener( new ComponentAdapter() { @Override public void componentShown(@SuppressWarnings("unused") ComponentEvent evt) { formComponentShown(); } }); }
private void formComponentShown() { if (!theHasBeenSizedFlag) { theHasBeenSizedFlag = true; if (theSplitPane != null) { final int s = SettingsHandler.getPCGenOption( "InfoCharacterSheet." + "splitLeftRight", // $NON-NLS-1$ (int) ((this.getSize().getWidth() * 6) / 10)); theSplitPane.setDividerLocation(s); theSplitPane.addPropertyChangeListener( JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent anEvt) { SettingsHandler.setPCGenOption( "InfoCharacterSheet." + "splitLeftRight", // $NON-NLS-1$ anEvt.getNewValue().toString()); } }); } } }
/** This method is called from within the constructor to initialize the form. */ private void initComponents() { setLayout(new BorderLayout()); theSheetSelectionPanel = new CharacterSheetSelectionPanel(theParent); add(theSheetSelectionPanel, BorderLayout.NORTH); eqSets = new ButtonGroup(); final FlippingSplitPane splitPane1 = new FlippingSplitPane(); eqSetPanel = new JPanel(); modifiersPanel = new JPanel(); splitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); splitPane1.setResizeWeight(0.5); eqSetPanel.setLayout(new BoxLayout(eqSetPanel, BoxLayout.Y_AXIS)); splitPane1.setLeftComponent(eqSetPanel); modifiersPanel.setLayout(new BoxLayout(modifiersPanel, BoxLayout.Y_AXIS)); splitPane1.setRightComponent(modifiersPanel); add(splitPane1, BorderLayout.CENTER); }