示例#1
0
  @Override
  public void useParametersFrom(FilterRepresentation a) {
    if (a instanceof FilterDrawRepresentation) {
      FilterDrawRepresentation representation = (FilterDrawRepresentation) a;
      mParamColor.copyPalletFrom(representation.mParamColor);
      try {
        if (representation.mCurrent != null) {
          mCurrent = (StrokeData) representation.mCurrent.clone();
        } else {
          mCurrent = null;
        }
        if (representation.mDrawing != null) {
          mDrawing = new Vector<StrokeData>();
          for (Iterator<StrokeData> elem = representation.mDrawing.iterator(); elem.hasNext(); ) {
            StrokeData next = elem.next();
            mDrawing.add(new StrokeData(next));
          }
        } else {
          mDrawing = null;
        }

      } catch (CloneNotSupportedException e) {
        e.printStackTrace();
      }
    } else {
      Log.v(LOGTAG, "cannot use parameters from " + a);
    }
  }
  public void setColorBorderRepresentation(FilterColorBorderRepresentation rep) {
    mRep = rep;
    BasicParameterInt size;
    size = (BasicParameterInt) mRep.getParam(FilterColorBorderRepresentation.PARAM_SIZE);
    mCBSizeSeekBar.setMax(size.getMaximum() - size.getMinimum());
    mCBSizeSeekBar.setProgress(size.getValue());

    BasicParameterInt radius;
    radius = (BasicParameterInt) mRep.getParam(FilterColorBorderRepresentation.PARAM_RADIUS);
    mCBCornerSizeSeekBar.setMax(radius.getMaximum() - radius.getMinimum());
    mCBCornerSizeSeekBar.setProgress(radius.getValue());

    ParameterColor color;
    color = (ParameterColor) mRep.getParam(FilterColorBorderRepresentation.PARAM_COLOR);
    mBasColors = color.getColorPalette();
    color.setValue(mBasColors[mSelectedColorButton]);
  }
示例#3
0
 public FilterDrawRepresentation() {
   super("Draw");
   setFilterClass(ImageFilterDraw.class);
   setSerializationName("DRAW");
   setFilterType(FilterRepresentation.TYPE_VIGNETTE);
   setTextId(R.string.imageDraw);
   setEditorId(EditorDraw.ID);
   setOverlayId(R.drawable.filtershow_drawing);
   setOverlayOnly(true);
   /// M: [BUG.ADD] @{
   // set default value,Use defalut red point draw line even if user not click color panel
   mParamColor.setValue(DEFAULT_MENU_COLOR1);
   /// @}
 }
示例#4
0
 private int computeCurrentColor() {
   return mParamColor.getValue();
 }