Ejemplo n.º 1
0
    /** Handles clicks on the show/hide icon to toggle the show-object status. */
    public void mouseClicked(MouseEvent e) {
      if (Application.isControlDown(e) || e.isShiftDown()) return;

      // get GeoElement at mouse location
      TreePath tp = getPathForLocation(e.getX(), e.getY());
      GeoElement geo = AlgebraView.getGeoElementForPath(tp);

      if (geo != null) {
        // check if we clicked on the 16x16 show/hide icon
        Rectangle rect = getPathBounds(tp);
        boolean iconClicked =
            rect != null && e.getX() - rect.x < 13; // distance from left border			
        if (iconClicked) {
          // icon clicked: toggle show/hide
          geo.setEuclidianVisible(!geo.isSetEuclidianVisible());
          geo.update();
          kernel.notifyRepaint();

          // update properties dialog by selecting this geo again
          geoElementSelected(geo, false);
        }
      }
    }