Example #1
0
 /**
  * Create the scale that is displayed. This is called automatically when <CODE>setRange(lo, hi)
  * </CODE> and <CODE>setDisplay</CODE> are called. It makes a call to <CODE>AxisScale.makeScale()
  * </CODE> where the actual hard work is done.
  *
  * @throws VisADException VisAD error.
  */
 public void makeScale() throws VisADException {
   if (axisScale != null) {
     DisplayRenderer displayRenderer = null;
     if (display == null) return;
     displayRenderer = display.getDisplayRenderer();
     if (displayRenderer == null) return;
     boolean scaleMade = axisScale.makeScale();
     if (scaleMade) {
       // displayRenderer.setScale(axis, axis_ordinal, array, scale_color);
       if (scale_on) {
         displayRenderer.setScale(axisScale);
       } else {
         displayRenderer.clearScale(axisScale);
       }
       scale_flag = false;
     }
   }
 }
Example #2
0
 public void displayChanged(DisplayEvent e) throws RemoteException, VisADException {
   if (e.getId() == DisplayEvent.FRAME_DONE) {
     DisplayImpl display = (DisplayImpl) e.getDisplay();
     DisplayRenderer dr = display.getDisplayRenderer();
     MouseBehavior mb = dr.getMouseBehavior();
     double[] position1 = null;
     double[] position2 = null;
     if (display instanceof DisplayImplJ3D) {
       position1 = new double[] {1.0, 1.0, 1.0};
       position2 = new double[] {-1.0, -1.0, -1.0};
     } else {
       position1 = new double[] {1.0, 1.0};
       position2 = new double[] {-1.0, -1.0};
     }
     int[] screen1 = mb.getScreenCoords(position1);
     int[] screen2 = mb.getScreenCoords(position2);
     // System.out.println("screen1 = (" + screen1[0] + ", " + screen1[1] +")");
     // System.out.println("screen2 = (" + screen2[0] + ", " + screen2[1] +")");
   }
 }