Java Code Examples for javax.swing.JSplitPane#setRightComponent()

The following examples show how to use javax.swing.JSplitPane#setRightComponent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SplitPaneOption.java    From JPPF with Apache License 2.0 6 votes vote down vote up
@Override
public void add(final OptionElement element) {
  final JSplitPane pane = (JSplitPane) UIComponent;
  if (FILLER1 == children.get(0)) {
    children.remove(0);
    children.add(0, element);
    pane.setLeftComponent(element.getUIComponent());
  } else if (FILLER2 == children.get(1)) {
    children.remove(1);
    children.add(1, element);
    pane.setRightComponent(element.getUIComponent());
  } else {
    final String msg = '[' + this.toString() + "] This split pane can't contain more than 2 elements";
    System.err.println(msg);
    log.error(msg);
    return;
  }
  if (element instanceof AbstractOptionElement) ((AbstractOptionElement) element).setParent(this);
}
 
Example 2
Source File: SplitPaneOption.java    From JPPF with Apache License 2.0 6 votes vote down vote up
@Override
public void remove(final OptionElement element) {
  final int idx = children.indexOf(element);
  if (idx < 0) return;
  final JSplitPane pane = (JSplitPane) UIComponent;
  if (idx == 0) {
    children.remove(0);
    children.add(0, FILLER1);
    pane.setLeftComponent(FILLER1.getUIComponent());
  } else {
    children.remove(1);
    children.add(1, FILLER2);
    pane.setRightComponent(FILLER2.getUIComponent());
  }
  if (element instanceof AbstractOptionElement) ((AbstractOptionElement) element).setParent(null);
}
 
Example 3
Source File: OptionsAction.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected TreeView initGui () {
    TTW retVal = new TTW () ;
    
    
    split = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT);
    PropertySheetView propertyView = new PropertySheetView();
    
    split.setLeftComponent(retVal);
    split.setRightComponent(propertyView);
    // install proper border for split pane
    split.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N

    setLayout (new java.awt.GridBagLayout ());

    GridBagConstraints gridBagConstraints = new GridBagConstraints ();
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.gridwidth = 2;
    add (split, gridBagConstraints);

    return retVal;
}
 
Example 4
Source File: SplitPaneOption.java    From JPPF with Apache License 2.0 5 votes vote down vote up
@Override
public void createUI() {
  final JSplitPane pane = new JSplitPane();
  pane.setOrientation(orientation == HORIZONTAL ? JSplitPane.HORIZONTAL_SPLIT : JSplitPane.VERTICAL_SPLIT);
  UIComponent = pane;
  children.add(FILLER1);
  children.add(FILLER2);
  pane.setLeftComponent(FILLER1.getUIComponent());
  pane.setRightComponent(FILLER2.getUIComponent());
  pane.setDividerSize(dividerWidth);
  pane.setResizeWeight(resizeWeight);
  pane.setOpaque(false);
}
 
Example 5
Source File: TestDesignUI.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 5 votes vote down vote up
private void init() {
    setLayout(new BorderLayout());
    projectNReusableTreeSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    projectNReusableTreeSplitPane.setOneTouchExpandable(true);
    projectNReusableTreeSplitPane.setResizeWeight(0.5);

    projectNReusableTreeSplitPane.setTopComponent(getTreeInPanel("Test Plan", testDesign.getProjectTree().getTree()));

    appReusablePanel = getRTreeInPanel("Reusable Component", testDesign.getReusableTree().getTree());
    projectNReusableTreeSplitPane.setBottomComponent(appReusablePanel);

    testCaseNTestDataSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    testCaseNTestDataSplitPane.setOneTouchExpandable(true);
    testCaseNTestDataSplitPane.setResizeWeight(0.5);

    testCaseNTestDataSplitPane.setTopComponent(testDesign.getTestCaseComponent());
    testCaseNTestDataSplitPane.setBottomComponent(testDesign.getTestDatacomp());

    oneTwo = new JSplitPane();
    oneTwo.setOneTouchExpandable(true);
    oneTwo.setResizeWeight(0.25);

    oneTwo.setLeftComponent(projectNReusableTreeSplitPane);
    oneTwo.setRightComponent(testCaseNTestDataSplitPane);

    oneThree = new JSplitPane();
    oneThree.setOneTouchExpandable(true);
    oneThree.setResizeWeight(0.8);

    oneThree.setLeftComponent(oneTwo);
    oneThree.setRightComponent(testDesign.getObjectRepo());

    add(oneThree);

}
 
Example 6
Source File: SectorRowsEditor.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
/**
 * This method initializes this
 *
 * @return void
 */
private void initialize() {
    setLayout(new BorderLayout());
    this.setSize(new Dimension(441, 231));
    JSplitPane splitPane = new JSplitPane();
    this.add(splitPane, java.awt.BorderLayout.CENTER);
    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    splitPane.setDividerLocation(0.75d);
    splitPane.setLeftComponent(getSelectRowPane());
    splitPane.setRightComponent(getJPanel4());
}
 
Example 7
Source File: SamlMain.java    From SAMLRaider with MIT License 5 votes vote down vote up
private void initializeUI(){
	setLayout(new BorderLayout(0, 0));
	
	JSplitPane splitPaneMain = new JSplitPane();
	splitPaneMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
	add(splitPaneMain, BorderLayout.CENTER);
	
	JPanel panelTop = new JPanel();
	splitPaneMain.setLeftComponent(panelTop);
	panelTop.setLayout(new BorderLayout(0, 0));
	
	JSplitPane splitPaneTop = new JSplitPane();
	splitPaneTop.setResizeWeight(0.3);
	panelTop.add(splitPaneTop);
	
	panelAction = new SamlPanelAction(controller);
	splitPaneTop.setLeftComponent(panelAction);
	
	panelInformation = new SamlPanelInfo();
	splitPaneTop.setRightComponent(panelInformation);
	
	JPanel panelText = new JPanel();
	splitPaneMain.setRightComponent(panelText);
	panelText.setLayout(new BorderLayout(0, 0));
	
	textArea = new JTextArea();
	textArea.setText("<SAMLRaiderFailureInInitialization></SAMLRaiderFailureInInitialization>");
       scrollPane = new JScrollPane(textArea);
       scrollPane.add(textArea);
       panelText.add(scrollPane, BorderLayout.CENTER);
       scrollPane.setViewportView(textArea);
	
       this.invalidate();
       this.updateUI();
}
 
Example 8
Source File: RSFViewer2.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
public RSFViewer2(final Engine engine) {
    this.engine = engine;
    this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    this.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            try {
                ((FileIEngineImpl) engine.getDeligate()).close();
            } catch (IOException e1) {
                e1.printStackTrace();
            }
            System.exit(0);
        }
    });
    this.setTitle("Ramus files viewer sample 2");

    JSplitPane pane = new JSplitPane();

    pane.setLeftComponent(createQualifiersList());
    pane.setRightComponent(createTreeView());

    this.setContentPane(pane);

    this.pack();
    this.setSize(800, 600);
    this.setLocationRelativeTo(null);
}
 
Example 9
Source File: JSplitPaneSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Removes a real component from a real container.
    * @param container instance of a real container
    * @param containerDelegate effective container delegate of the container
    * @param component component to be removed
    * @return whether it was possible to remove the component (some containers
    *         may not support removing individual components reasonably)
    */
   @Override
   public boolean removeComponentFromContainer(Container container,
                                               Container containerDelegate,
                                               Component component)
   {
if( !(containerDelegate instanceof JSplitPane) ) {
    return false; // should not happen
}	

JSplitPane splitPane = (JSplitPane) containerDelegate;

if( component == splitPane.getLeftComponent() ) { 
    if( super.removeComponentFromContainer(container, containerDelegate, component) ) {
	JButton left = (JButton) splitPane.getClientProperty(LEFT_TOP_BUTTON);
	if( left != null ) {
	    // fall back to the default swing setting
	    splitPane.setLeftComponent(left);
	    splitPane.putClientProperty(LEFT_TOP_BUTTON, null);
	}	
	return true;
    }
} else if ( component == splitPane.getRightComponent() ) {    
    if( super.removeComponentFromContainer(container, containerDelegate, component) ) {
	JButton right = (JButton) splitPane.getClientProperty(RIGHT_BOTTOM_BUTTON);
	if( right != null ) {
	    // fall back to the default swing setting		    
	    splitPane.setRightComponent(right);		    
	    splitPane.putClientProperty(RIGHT_BOTTOM_BUTTON, null);
	}	
	return true;
    }
}

       return super.removeComponentFromContainer(container, containerDelegate, component);
   }
 
Example 10
Source File: DatFileViewer.java    From settlers-remake with MIT License 5 votes vote down vote up
private DatFileViewer() {
	glCanvas = new Surface();

	JPanel infoField = new JPanel();
	infoField.setLayout(new BoxLayout(infoField, BoxLayout.PAGE_AXIS));

	lblDatType = new JLabel();
	lblNumUiSeqs = new JLabel();
	lblNumSettlerSeqs = new JLabel();
	lblNumLandscapeSeqs = new JLabel();

	infoField.add(lblDatType);
	infoField.add(lblNumSettlerSeqs);
	infoField.add(lblNumLandscapeSeqs);
	infoField.add(lblNumUiSeqs);

	listItems = new DefaultListModel<>();
	listView = new JList<>(listItems);
	listView.getSelectionModel().addListSelectionListener(this);

	JSplitPane splitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
	splitPane2.setTopComponent(new JScrollPane(listView));
	splitPane2.setBottomComponent(infoField);
	splitPane2.setResizeWeight(0.5);
	splitPane2.setEnabled(false);

	JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	splitPane.setLeftComponent(splitPane2);
	splitPane.setRightComponent(glCanvas);
	splitPane.setResizeWeight(0.10);

	this.setTitle("DatFileViewer");
	this.setJMenuBar(createMenu());
	this.getContentPane().add(splitPane);
	this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
	this.setSize(new Dimension(800, 600));
	this.setVisible(true);
}
 
Example 11
Source File: ParameterDialog.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected Component createContentPane() {
  final JSplitPane mainPanel = new JSplitPane();
  mainPanel.setOrientation( JSplitPane.HORIZONTAL_SPLIT );
  mainPanel.setLeftComponent( provisionDataSourcePanel );
  mainPanel.setRightComponent( createDetailsPanel() );
  mainPanel.setDividerLocation( 300 );
  return mainPanel;
}
 
Example 12
Source File: GltfBrowserPanel.java    From JglTF with MIT License 5 votes vote down vote up
/**
 * Creates a new browser panel for the given {@link GltfModel}
 * 
 * @param gltfModel The {@link GltfModel}
 */
GltfBrowserPanel(GltfModel gltfModel)
{
    super(new BorderLayout());
    
    this.gltfModel = Objects.requireNonNull(
        gltfModel, "The gltfModel may not be null");
    this.selectionPathHistory = new LinkedList<TreePath>();
    this.infoComponentFactory = new InfoComponentFactory(gltfModel);
    
    Object gltf = getGltf(gltfModel);
    this.resolver = new Resolver(gltf);
    
    add(createControlPanel(), BorderLayout.NORTH);
    
    JSplitPane mainSplitPane = new JSplitPane();
    add(mainSplitPane, BorderLayout.CENTER);
    SwingUtilities.invokeLater(new Runnable()
    {
        @Override
        public void run()
        {
            mainSplitPane.setDividerLocation(0.3);
        }
    });
    
    mainSplitPane.setLeftComponent(
        createTreePanel(gltf));
    
    mainTabbedPane = new JTabbedPane();
    mainSplitPane.setRightComponent(mainTabbedPane);
    
    infoPanelContainer = new JPanel(new GridLayout(1,1));
    mainTabbedPane.addTab("Info", infoPanelContainer);
    
    gltfViewerPanel = new GltfViewerPanel(gltfModel);
    mainTabbedPane.addTab("View", gltfViewerPanel);
}
 
Example 13
Source File: LobbyFrame.java    From triplea with GNU General Public License v3.0 4 votes vote down vote up
public LobbyFrame(final LobbyClient lobbyClient, final ServerProperties serverProperties) {
  super("TripleA Lobby");
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  setIconImage(JFrameBuilder.getGameIcon());
  this.lobbyClient = lobbyClient;
  setJMenuBar(new LobbyMenu(this));
  chatTransmitter =
      new LobbyChatTransmitter(
          lobbyClient.getPlayerToLobbyConnection(), lobbyClient.getUserName());
  final Chat chat = new Chat(chatTransmitter);
  final ChatMessagePanel chatMessagePanel = new ChatMessagePanel(chat, ChatSoundProfile.LOBBY);
  chatMessagePanel.addServerMessage(serverProperties.getMessage());
  final ChatPlayerPanel chatPlayers = new ChatPlayerPanel(chat);
  chatPlayers.setPreferredSize(new Dimension(200, 600));
  chatPlayers.addActionFactory(this::lobbyPlayerRightClickMenuActions);

  tableModel =
      new LobbyGameTableModel(
          lobbyClient.isModerator(), lobbyClient.getPlayerToLobbyConnection());
  final LobbyGamePanel gamePanel =
      new LobbyGamePanel(this, lobbyClient, serverProperties.getUri(), tableModel);

  final JSplitPane leftSplit = new JSplitPane();
  leftSplit.setOrientation(JSplitPane.VERTICAL_SPLIT);
  leftSplit.setTopComponent(gamePanel);
  leftSplit.setBottomComponent(chatMessagePanel);
  leftSplit.setResizeWeight(0.5);
  gamePanel.setPreferredSize(new Dimension(700, 200));
  chatMessagePanel.setPreferredSize(new Dimension(700, 400));
  final JSplitPane mainSplit = new JSplitPane();
  mainSplit.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
  mainSplit.setLeftComponent(leftSplit);
  mainSplit.setRightComponent(chatPlayers);
  mainSplit.setResizeWeight(1);
  add(mainSplit, BorderLayout.CENTER);
  pack();
  chatMessagePanel.requestFocusInWindow();
  setLocationRelativeTo(null);
  lobbyClient
      .getPlayerToLobbyConnection()
      .addConnectionTerminatedListener(
          reason -> {
            DialogBuilder.builder()
                .parent(this)
                .title("Connection to Lobby Closed")
                .errorMessage("Connection closed: " + reason)
                .showDialog();
            shutdown();
          });
  lobbyClient.getPlayerToLobbyConnection().addConnectionClosedListener(this::shutdown);
  addWindowListener(
      new WindowAdapter() {
        @Override
        public void windowClosing(final WindowEvent e) {
          shutdown();
        }
      });
}
 
Example 14
Source File: HistoryWindow.java    From Spark with Apache License 2.0 4 votes vote down vote up
private Component getHistoryContentPanel() {
	JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
	splitPane.setLeftComponent(historyTreeView);
	splitPane.setRightComponent(getMessagesPanel());
	return splitPane;
}
 
Example 15
Source File: CasTreeViewer.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a CAS Tree Viewer.
 *
 * @param aCAS          the CAS containing the annotations to be displayed in the tree viewer GUI
 * @throws CASException the CAS exception
 */
public CasTreeViewer(CAS aCAS) throws CASException {
  super();

  // build tree from annotations in CAS
  TreeNode root = buildTree(aCAS);

  // create a JSplitPane
  splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  splitPane.setResizeWeight(0.66);
  this.add(splitPane);

  // build JTree and add to left side of JSplitPane
  tree = new JTree(root);
  splitPane.setLeftComponent(new JScrollPane(tree));

  // add a JPanel with a JLabel (annotation type name), JTextArea (covered text),
  // and JTable (features and their values) to the right side of JSplitPane
  rightPanel = new JPanel();
  rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
  annotationTypeLabel = new JLabel("Annotation Type: ");
  rightPanel.add(annotationTypeLabel);
  String[] columnNames = { "Feature", "Value" };
  featureTable = new JTable(new DefaultTableModel(columnNames, 1));

  rightPanel.add(new JScrollPane(featureTable));
  annotationTextPane = new JTextPane();
  rightPanel.add(new JScrollPane(annotationTextPane));
  splitPane.setRightComponent(rightPanel);

  // add an event handler to catch tree selection changes and update the table
  tree.addTreeSelectionListener(new TreeSelectionListener() {
    @Override
    public void valueChanged(TreeSelectionEvent aEvent) {
      TreePath selPath = tree.getSelectionPath();
      if (selPath != null) {
        DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) selPath
                .getLastPathComponent();
        Object userObj = selectedNode.getUserObject();
        if (userObj instanceof AnnotationTreeNodeObject) {
          AnnotationFS annotation = ((AnnotationTreeNodeObject) userObj).getAnnotation();
          refreshAnnotationData(annotation);
        }
      }
    }

  });
}
 
Example 16
Source File: MainGui.java    From audiveris with GNU Affero General Public License v3.0 4 votes vote down vote up
private void defineLayout ()
{
    // +=============================================================+
    // |toolKeyPanel . . . . . . . . . . . . . . . . . . . . . . . . |
    // |+=================+=============================+===========+|
    // || toolBar . . . . . . . . . .| progressBar . . .| Memory . .||
    // |+=================+=============================+===========+|
    // +=============================================================+
    // | horiSplitPane . . . . . . . . . . . . . . . . . . . . . . . |
    // |+=========================================+=================+|
    // | . . . . . . . . . . . . . . . . . . . . .|boardsScrollPane ||
    // | +========================================+ . . . . . . . . ||
    // | | stubsController . . . . . . . . . . . .| . . . . . . . . ||
    // | | . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // | | . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // | | . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // | | . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // | | . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // | | . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // | | . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // |m| . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // |a| . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // |i| . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // |n| . . . . . . . . . . . . . . . . . . . .| . . . . . . . . ||
    // |P+=====================+==================+ . . . . . . . . ||
    // |a| logPane . . . . . . | errors . . . . . | . . . . . . . . ||
    // |n| . . . . . . . . . . |. . . . . . . . . | . . . . . . . . ||
    // |e| . . . . . . . . . . |. . . . . . . . . | . . . . . . . . ||
    // | +=====================+==================+=================+|
    // +=============================================================+
    //

    // Individual panes
    logPane = new LogPane();
    boardsScrollPane = new BoardsScrollPane();
    boardsScrollPane.setPreferredSize(new Dimension(350, 500));

    // Bottom = Log & Errors
    bottomPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    bottomPane.setBorder(null);
    bottomPane.setDividerSize(1);
    bottomPane.setResizeWeight(0.5d); // Cut in half initially

    // mainPane =  stubsController / bottomPane
    mainPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, stubsController.getComponent(), null);
    mainPane.setBorder(null);
    mainPane.setOneTouchExpandable(true);
    mainPane.setResizeWeight(0.9d); // Give bulk space to upper part

    // horiSplitPane = mainPane | boards
    appPane = new Panel();
    appPane.setNoInsets();
    appPane.setBorder(null);
    appPane.setLayout(new BorderLayout());
    appPane.add(mainPane, BorderLayout.CENTER); // + boardsScrollPane later
    appPane.setName("appPane");

    // Global layout: Use a toolbar on top and a double split pane below
    ///toolBar.add(toolKeyPanel);
    Container content = frame.getContentPane();
    content.setLayout(new BorderLayout());
    content.add(ActionManager.getInstance().getToolBar(), BorderLayout.NORTH);
    content.add(appPane, BorderLayout.CENTER);

    // Display the boards pane?
    if (GuiActions.getInstance().isBoardsWindowDisplayed()) {
        appPane.add(boardsScrollPane, BorderLayout.EAST);
    }

    // Display the log pane?
    if (GuiActions.getInstance().isLogWindowDisplayed()) {
        bottomPane.setLeftComponent(logPane.getComponent());
    }

    // Display the errors pane?
    if (GuiActions.getInstance().isErrorsWindowDisplayed()) {
        bottomPane.setRightComponent(null);
    }

    // BottomPane = Log & Errors
    if (needBottomPane()) {
        mainPane.setBottomComponent(bottomPane);
    }
}
 
Example 17
Source File: OnePageAnalysisWindow.java    From wpcleaner with Apache License 2.0 4 votes vote down vote up
/**
 * @return Window components.
 */
@Override
protected Component createComponents() {
  JPanel panel = new JPanel(new GridBagLayout());

  // Initialize constraints
  GridBagConstraints constraints = new GridBagConstraints();
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.gridheight = 1;
  constraints.gridwidth = 1;
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.insets = new Insets(2, 2, 2, 2);
  constraints.ipadx = 0;
  constraints.ipady = 0;
  constraints.weightx = 0;
  constraints.weighty = 0;

  // Page name
  //constraints.gridwidth = 2;
  panel.add(createPageComponents(), constraints);
  constraints.gridy++;

  // Contents
  constraints.fill = GridBagConstraints.BOTH;
  constraints.gridwidth = 1;
  constraints.gridx = 0;
  constraints.weightx = 1;
  constraints.weighty = 1;
  JSplitPane splitLinks = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
  splitLinks.setLeftComponent(createLinksComponents());
  splitLinks.setRightComponent(createCheckWikiComponents());
  splitLinks.setResizeWeight(1.0);
  splitLinks.setDividerLocation(0.9);
  JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  split.setLeftComponent(splitLinks);
  split.setRightComponent(createContentsComponents());
  split.setPreferredSize(new Dimension(1200, 700));
  split.setMinimumSize(new Dimension(200, 200));
  split.setResizeWeight(0.0);
  split.setDividerLocation(200 + split.getInsets().left);
  panel.add(split, constraints);
  constraints.gridy++;

  updateComponentState();
  return panel;
}
 
Example 18
Source File: CreatePullRequestForm.java    From azure-devops-intellij with MIT License 4 votes vote down vote up
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    createUIComponents();
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(9, 4, new Insets(0, 0, 0, 0), -1, -1));
    sourceBranchLabel = new JLabel();
    this.$$$loadLabelText$$$(sourceBranchLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.SourceBranchLabel"));
    contentPanel.add(sourceBranchLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    titleLabel = new JLabel();
    this.$$$loadLabelText$$$(titleLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.TitleLabel"));
    contentPanel.add(titleLabel, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    descriptionLabel = new JLabel();
    this.$$$loadLabelText$$$(descriptionLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.DescriptionLabel"));
    contentPanel.add(descriptionLabel, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    titleTextField = new JTextField();
    contentPanel.add(titleTextField, new GridConstraints(5, 0, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    targetBranchLabel = new JLabel();
    this.$$$loadLabelText$$$(targetBranchLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.TargetBranchLabel"));
    contentPanel.add(targetBranchLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    contentPanel.add(targetBranchDropdown, new GridConstraints(2, 0, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    sourceBranch = new JLabel();
    sourceBranch.setText("");
    contentPanel.add(sourceBranch, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    splitPane = new JSplitPane();
    splitPane.setOrientation(0);
    contentPanel.add(splitPane, new GridConstraints(7, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false));
    descriptionScrollPane = new JScrollPane();
    splitPane.setLeftComponent(descriptionScrollPane);
    descriptionTextArea = new JTextArea();
    descriptionTextArea.setLineWrap(true);
    descriptionTextArea.setWrapStyleWord(true);
    descriptionScrollPane.setViewportView(descriptionTextArea);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    splitPane.setRightComponent(panel1);
    quickDiffPane = new JTabbedPane();
    panel1.add(quickDiffPane, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false));
    spinnerPanel = new JPanel();
    spinnerPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
    panel1.add(spinnerPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
    spinner = new BusySpinnerPanel();
    spinnerPanel.add(spinner);
    loadingLabel = new JLabel();
    this.$$$loadLabelText$$$(loadingLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CreatePullRequestDialog.LoadingDiffLabel"));
    spinnerPanel.add(loadingLabel);
}
 
Example 19
Source File: LanguageChooserDialog.java    From pcgen with GNU Lesser General Public License v2.1 4 votes vote down vote up
private void initComponents()
{
	setTitle(chooser.getName());
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	addWindowListener(new WindowAdapter()
	{

		@Override
		public void windowClosed(WindowEvent e)
		{
			//detach listeners from the chooser
			treeViewModel.setDelegate(null);
			listModel.setListFacade(null);
			chooser.getRemainingSelections().removeReferenceListener(LanguageChooserDialog.this);
		}

	});
	Container pane = getContentPane();
	pane.setLayout(new BorderLayout());

	JSplitPane split = new JSplitPane();
	JPanel leftPane = new JPanel(new BorderLayout());
	//leftPane.add(new JLabel("Available Languages"), BorderLayout.NORTH);
	availTable.setAutoCreateRowSorter(true);
	availTable.setTreeViewModel(treeViewModel);
	availTable.getRowSorter().toggleSortOrder(0);
	availTable.addActionListener(new DoubleClickActionListener());
	leftPane.add(new JScrollPane(availTable), BorderLayout.CENTER);

	Button addButton = new Button(LanguageBundle.getString("in_sumLangAddLanguage"));
	addButton.setOnAction(this::doAdd);
	addButton.setGraphic(new ImageView(Icons.Forward16.asJavaFX()));
	leftPane.add(GuiUtility.wrapParentAsJFXPanel(addButton), BorderLayout.PAGE_END);

	split.setLeftComponent(leftPane);

	JPanel rightPane = new JPanel(new BorderLayout());
	JPanel labelPane = new JPanel(new GridBagLayout());

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.gridwidth = GridBagConstraints.REMAINDER;
	labelPane.add(new JLabel(LanguageBundle.getString("in_sumLangRemain")), //$NON-NLS-1$
		new GridBagConstraints());
	remainingLabel.setText(chooser.getRemainingSelections().get().toString());
	labelPane.add(remainingLabel, gbc);
	labelPane.add(new JLabel(LanguageBundle.getString("in_sumSelectedLang")), gbc); //$NON-NLS-1$
	rightPane.add(labelPane, BorderLayout.PAGE_START);

	list.setModel(listModel);
	list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	list.addActionListener(new DoubleClickActionListener());
	rightPane.add(new JScrollPane(list), BorderLayout.CENTER);

	Button removeButton = new Button(LanguageBundle.getString("in_sumLangRemoveLanguage"));
	removeButton.setOnAction(this::doRemove);
	removeButton.setGraphic(new ImageView(Icons.Back16.asJavaFX()));
	rightPane.add(GuiUtility.wrapParentAsJFXPanel(removeButton), BorderLayout.PAGE_END);

	split.setRightComponent(rightPane);
	pane.add(split, BorderLayout.CENTER);
	ButtonBar buttonBar = new OKCloseButtonBar(
			this::doOK,
			this::doRollback
	);
	pane.add(GuiUtility.wrapParentAsJFXPanel(buttonBar), BorderLayout.PAGE_END);
}
 
Example 20
Source File: ReversiPlugin.java    From Spark with Apache License 2.0 3 votes vote down vote up
/**
 * Displays the game board. This is called after an offer has been accepted
 * or after accepting an invitation.
 * 
 * @param gameID
 *            the game ID.
 * @param room
 *            the chat room to display the game board in.
 * @param startingPlayer
 *            true if this player is the starting player (black).
 * @param opponentJID
 *            the opponent's JID.
 */
private void showReversiBoard(int gameID, ChatRoom room, boolean startingPlayer, Jid opponentJID) {
    JSplitPane pane = room.getSplitPane();
    pane.setResizeWeight(1.0);
    BackgroundPanel reversiBackground = new BackgroundPanel();
    reversiBackground.setLayout(new BorderLayout());
    reversiBackground.setOpaque(false);
    ReversiPanel reversi = new ReversiPanel(SparkManager.getConnection(), gameID, startingPlayer, opponentJID);
    reversiBackground.add(reversi, BorderLayout.CENTER);
    pane.setRightComponent(reversiBackground);
    reversi.setMinimumSize(new Dimension(ReversiPanel.TOTAL_WIDTH, ReversiPanel.TOTAL_HEIGHT));
}