コード例 #1
0
 /**
  * Retrieves the currently selected legend in the tree and shows the corresponding dialog in the
  * card layout; shows the empty panel if no legend is selected.
  */
 protected void showDialogForCurrentlySelectedLegend() {
   ISELegendPanel selected = legendTree.getSelectedPanel();
   if (selected != null) {
     cardLayout.show(dialogContainer, selected.getId());
   } else {
     cardLayout.show(dialogContainer, NO_LEGEND_ID);
   }
 }
コード例 #2
0
 /**
  * Remove the given panel from the card layout and refresh the display.
  *
  * @param panel Panel
  */
 public void legendRemoved(ISELegendPanel panel) {
   cardLayout.removeLayoutComponent(panel.getComponent());
   showDialogForCurrentlySelectedLegend();
 }
コード例 #3
0
 // TODO: Should this method be moved to LegendTree?
 public void legendAdded(ISELegendPanel panel) {
   panel.setId(createNewID());
   dialogContainer.add(panel.getId(), getJScrollPane(panel));
   showDialogForCurrentlySelectedLegend();
 }
コード例 #4
0
 /** Shows the dialog for the given legend in the card layout. */
 protected void showDialogForLegend(ISELegendPanel selected) {
   cardLayout.show(dialogContainer, selected.getId());
 }
コード例 #5
0
 /**
  * Gets a new {@link JScrollPane} on the given panel, setting the scroll increments appropriately.
  *
  * @param panel Panel
  * @return A new {@link JScrollPane} on the given panel
  */
 private JScrollPane getJScrollPane(ISELegendPanel panel) {
   JScrollPane jsp = new JScrollPane(panel.getComponent());
   jsp.getHorizontalScrollBar().setUnitIncrement(INCREMENT);
   jsp.getVerticalScrollBar().setUnitIncrement(INCREMENT);
   return jsp;
 }