コード例 #1
0
  @Override
  protected final GeoElement[] perform(Command c) throws MyError {
    int n = c.getArgumentNumber();
    GeoElement arg2[];
    switch (n) {
      case 2:
        arg2 = resArgs(c);
        if (arg2[1].isGeoBoolean()) {

          GeoElement geo = arg2[0];

          try {
            geo.setShowObjectCondition((GeoBoolean) arg2[1]);
          } catch (CircularDefinitionException e) {
            e.printStackTrace();
            throw argErr(app, c.getName(), arg2[1]);
          }
          geo.updateRepaint();

          return new GeoElement[0];
        }
        throw argErr(app, c.getName(), arg2[1]);

      default:
        throw argNumErr(app, c.getName(), n);
    }
  }
コード例 #2
0
 private void applyUseAsText(ArrayList<GeoElement> geos) {
   // btnUseAsText
   for (int i = 0; i < geos.size(); i++) {
     GeoElement geo = geos.get(i);
     if (geo instanceof GeoCasCell) {
       ((GeoCasCell) geo).setUseAsText(btnUseAsText.isSelected());
       geo.updateRepaint();
       needUndo = true;
     }
   }
 }
コード例 #3
0
  private void applyTextColor(ArrayList<GeoElement> geos) {

    Color color = org.geogebra.desktop.awt.GColorD.getAwtColor(btnTextColor.getSelectedColor());
    for (int i = 0; i < geos.size(); i++) {
      GeoElement geo = geos.get(i);
      if (geo instanceof GeoCasCell) {
        ((GeoCasCell) geo).setFontColor(new org.geogebra.desktop.awt.GColorD(color));
        geo.updateRepaint();
        needUndo = true;
      }
    }
  }
コード例 #4
0
  private void applyFontStyle(ArrayList<GeoElement> geos) {

    int fontStyle = 0;
    if (btnBold.isSelected()) fontStyle += 1;
    if (btnItalic.isSelected()) fontStyle += 2;
    for (int i = 0; i < geos.size(); i++) {
      GeoElement geo = geos.get(i);
      Log.debug(((GeoCasCell) geo).getGeoText());
      if (geo instanceof GeoCasCell
          && ((GeoCasCell) geo).getGeoText().getFontStyle() != fontStyle) {
        ((GeoCasCell) geo).getGeoText().setFontStyle(fontStyle);
        geo.updateRepaint();
        needUndo = true;
      }
    }
  }
コード例 #5
0
  private void applyTextSize(ArrayList<GeoElement> geos) {

    double fontSize =
        GeoText.getRelativeFontSize(
            btnTextSize.getSelectedIndex()); // transform indices to the range -4, .. ,
    // 4

    for (int i = 0; i < geos.size(); i++) {
      GeoElement geo = geos.get(i);
      if (geo instanceof GeoCasCell
          && ((GeoCasCell) geo).getGeoText().getFontSizeMultiplier() != fontSize) {
        ((GeoCasCell) geo).setFontSizeMultiplier(fontSize);
        geo.updateRepaint();
        needUndo = true;
      }
    }
  }
コード例 #6
0
ファイル: LayerModel.java プロジェクト: geogebra/geogebra
 @Override
 protected void apply(int index, int value) {
   GeoElement geo = getGeoAt(index);
   geo.setLayer(value);
   geo.updateRepaint();
 }