コード例 #1
0
  protected boolean isAxisSelected(GlimpseMouseEvent e) {
    GlimpseAxisLayout1D layout = getAxisLayout(e);
    if (layout == null) return false;

    if (e.isKeyDown(ModifierKey.Shift)) return true;
    if (layout.isHorizontal() && e.getY() < axisSize) return true;
    if (!layout.isHorizontal() && e.getX() < axisSize) return true;

    return false;
  }
コード例 #2
0
  @Override
  public void mouseMoved(GlimpseMouseEvent e) {
    GlimpseAxisLayout1D layout = getAxisLayout(e);
    if (layout == null) return;

    if (e.isAnyButtonDown() && this.axisSelected) {
      super.mouseMoved(e);
      e.setHandled(true);
    }
  }
コード例 #3
0
  @Override
  public void mouseWheelMoved(GlimpseMouseEvent e) {
    this.axisSelected = isAxisSelected(e);

    if (this.axisSelected) {
      super.mouseWheelMoved(e);
      e.setHandled(true);
    }
  }
コード例 #4
0
  @Override
  public void mousePressed(GlimpseMouseEvent e) {
    plot.setSelectedPlot(info);

    this.axisSelected = isAxisSelected(e);

    if (this.axisSelected) {
      super.mousePressed(e);
      e.setHandled(true);
    }
  }