public void reload() { tableModel = new DependencyTableModel(new ArrayList<DependencyDTO>(), dataControl); fromModuleScrollPane.setBorder(new TitledBorder(dataControl.translate("FromModuleTreeTitle"))); toModuleScrollPane.setBorder(new TitledBorder(dataControl.translate("ToModuleTreeTitle"))); dependencyScrollPane.setBorder(new TitledBorder(dataControl.translate("DependencyTableTitle"))); filterPanel.setBorder(new TitledBorder(dataControl.translate("AnalyseDependencyFilter"))); this.indirectFilterBox.setText(dataControl.translate("ShowIndirectDependencies")); toModuleScrollPane.repaint(); fromModuleScrollPane.repaint(); dependencyScrollPane.repaint(); filterPanel.repaint(); updateTableModel(); this.repaint(); }
public DependencyPanel() { dataControl = new AnalyseUIController(); this.indirectFilterBox = new JCheckBox(dataControl.translate("ShowIndirectDependencies")); this.indirectFilterBox.addActionListener(this); createLayout(); dependencyTable = new JTable(); tableModel = new DependencyTableModel(new ArrayList<DependencyDTO>(), dataControl); dependencyTable.setModel(tableModel); dependencyScrollPane.setViewportView(dependencyTable); dependencyTable.setBackground(UIManager.getColor("Panel.background")); dependencyTable.setAutoCreateRowSorter(true); initialiseTrees(); setLayout(theLayout); }
private void createLayout() { fromModuleScrollPane = new JScrollPane(); fromModuleScrollPane.setBorder(new TitledBorder(dataControl.translate("FromModuleTreeTitle"))); toModuleScrollPane = new JScrollPane(); toModuleScrollPane.setBorder(new TitledBorder(dataControl.translate("ToModuleTreeTitle"))); dependencyScrollPane = new JScrollPane(); dependencyScrollPane.setBorder(new TitledBorder(dataControl.translate("DependencyTableTitle"))); this.filterPanel = new JPanel(); FlowLayout flowLayout = (FlowLayout) filterPanel.getLayout(); flowLayout.setAlignment(FlowLayout.LEFT); filterPanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); filterPanel.setBorder(new TitledBorder(dataControl.translate("AnalyseDependencyFilter"))); theLayout = new GroupLayout(this); theLayout.setHorizontalGroup( theLayout .createParallelGroup(Alignment.TRAILING) .addGroup( theLayout .createSequentialGroup() .addContainerGap() .addGroup( theLayout .createParallelGroup(Alignment.TRAILING) .addComponent( dependencyScrollPane, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE) .addComponent( filterPanel, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE) .addGroup( theLayout .createSequentialGroup() .addComponent( fromModuleScrollPane, GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE) .addGap(18) .addComponent( toModuleScrollPane, GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE))) .addContainerGap())); theLayout.setVerticalGroup( theLayout .createParallelGroup(Alignment.LEADING) .addGroup( theLayout .createSequentialGroup() .addContainerGap() .addGroup( theLayout .createParallelGroup(Alignment.LEADING) .addComponent( fromModuleScrollPane, GroupLayout.DEFAULT_SIZE, 235, Short.MAX_VALUE) .addComponent( toModuleScrollPane, GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED) .addComponent( filterPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent( dependencyScrollPane, GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE) .addContainerGap())); indirectFilterBox.setSelected(true); indirectFilterBox.setHorizontalAlignment(SwingConstants.LEFT); filterPanel.add(indirectFilterBox); fromModuleScrollPane.setBackground(PANELBACKGROUND); toModuleScrollPane.setBackground(PANELBACKGROUND); dependencyScrollPane.setBackground(UIManager.getColor("Panel.background")); }