Exemple #1
0
 public boolean hasChanges() {
   if (layerColour.getRed() != model.getRed()
       || layerColour.getGreen() != model.getGreen()
       || layerColour.getBlue() != model.getBlue()
       || ((float) layerColour.getAlpha() / 255f) != model.getOpacity()) return true;
   else return false;
 }
Exemple #2
0
 public void resetPolygonChanges() {
   // split model polygon string into separate polygons
   polygons.removeAllElements();
   if (model.getPolygons().length() > 0) {
     for (String polygon : model.getPolygons().split("\\|"))
       polygons.addElement(new RelativePolygon(polygon, scaleX, scaleY));
   }
 }
Exemple #3
0
  public HILayer(HiLayer model, int scaleX, int scaleY) {
    this.model = model;
    this.scaleX = scaleX;
    this.scaleY = scaleY;
    this.layerColour =
        new Color(
            model.getRed(), model.getGreen(), model.getBlue(), (int) (model.getOpacity() * 255));

    // split model polygon string into separate polygons
    if (model.getPolygons().length() > 0) {
      for (String polygon : model.getPolygons().split("\\|"))
        polygons.addElement(new RelativePolygon(polygon, scaleX, scaleY));
    }
  }
Exemple #4
0
 public void resetChanges() {
   this.layerColour =
       new Color(
           model.getRed(), model.getGreen(), model.getBlue(), (int) (model.getOpacity() * 255));
 }
Exemple #5
0
 public boolean hasPolygonChanges() {
   if (model.getPolygons().compareTo(serializePolygons()) != 0) return true;
   return false;
 }
Exemple #6
0
 public void syncPolygonChanges() {
   model.setPolygons(serializePolygons());
 }
Exemple #7
0
 public void syncChanges() {
   model.setRed(layerColour.getRed());
   model.setGreen(layerColour.getGreen());
   model.setBlue(layerColour.getBlue());
   model.setOpacity(((float) layerColour.getAlpha()) / 255f);
 }