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; }
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)); } }
public void resetChanges() { this.layerColour = new Color( model.getRed(), model.getGreen(), model.getBlue(), (int) (model.getOpacity() * 255)); }