~ubuntu-branches/ubuntu/vivid/elki/vivid

« back to all changes in this revision

Viewing changes to src/de/lmu/ifi/dbs/elki/visualization/gui/ResultVisualizer.java

  • Committer: Package Import Robot
  • Author(s): Erich Schubert
  • Date: 2012-12-14 20:45:15 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20121214204515-4m0d0er9ivtu5w9d
Tags: 0.5.5-1
New upstream release: 0.5.5 interim release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import javax.swing.JFrame;
27
27
 
 
28
import de.lmu.ifi.dbs.elki.gui.GUIUtil;
28
29
import de.lmu.ifi.dbs.elki.logging.Logging;
29
30
import de.lmu.ifi.dbs.elki.result.HierarchicalResult;
30
31
import de.lmu.ifi.dbs.elki.result.Result;
51
52
  /**
52
53
   * Get a logger for this class.
53
54
   */
54
 
  protected final static Logging logger = Logging.getLogger(ResultVisualizer.class);
 
55
  private static final Logging LOG = Logging.getLogger(ResultVisualizer.class);
55
56
 
56
57
  /**
57
58
   * Parameter to specify the window title
62
63
   * Default value: "ELKI Result Visualization"
63
64
   * </p>
64
65
   */
65
 
  public static final OptionID WINDOW_TITLE_ID = OptionID.getOrCreateOptionID("vis.window.title", "Title to use for visualization window.");
 
66
  public static final OptionID WINDOW_TITLE_ID = new OptionID("vis.window.title", "Title to use for visualization window.");
66
67
 
67
68
  /**
68
69
   * Flag to set single display
71
72
   * Key: -vis.single
72
73
   * </p>
73
74
   */
74
 
  public final static OptionID SINGLE_ID = OptionID.getOrCreateOptionID("vis.window.single", "Embed visualizers in a single window, not using thumbnails and detail views.");
 
75
  public static final OptionID SINGLE_ID = new OptionID("vis.window.single", "Embed visualizers in a single window, not using thumbnails and detail views.");
75
76
  
76
77
  /**
77
78
   * Stores the set title.
81
82
  /**
82
83
   * Default title
83
84
   */
84
 
  protected final static String DEFAULT_TITLE = "ELKI Result Visualization";
 
85
  protected static final String DEFAULT_TITLE = "ELKI Result Visualization";
85
86
 
86
87
  /**
87
88
   * Visualization manager.
124
125
      @Override
125
126
      public void run() {
126
127
        try {
 
128
          GUIUtil.setLookAndFeel();
127
129
          ResultWindow window = new ResultWindow(title, top, context, single);
128
130
          window.setVisible(true);
129
131
          window.setExtendedState(window.getExtendedState() | JFrame.MAXIMIZED_BOTH);
130
132
          window.showOverview();
131
133
        }
132
134
        catch(Throwable e) {
133
 
          logger.exception("Error in starting visualizer window.", e);
 
135
          LOG.exception("Error in starting visualizer window.", e);
134
136
        }
135
137
      }
136
138
    });
162
164
    @Override
163
165
    protected void makeOptions(Parameterization config) {
164
166
      super.makeOptions(config);
165
 
      StringParameter titleP = new StringParameter(WINDOW_TITLE_ID, true);
 
167
      StringParameter titleP = new StringParameter(WINDOW_TITLE_ID);
 
168
      titleP.setOptional(true);
166
169
      if(config.grab(titleP)) {
167
170
        title = titleP.getValue();
168
171
      }
169
172
      Flag singleF = new Flag(SINGLE_ID);
170
173
      if (config.grab(singleF)) {
171
 
        single = singleF.getValue();
 
174
        single = singleF.isTrue();
172
175
      }
173
176
      manager = config.tryInstantiate(VisualizerParameterizer.class);
174
177
    }