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 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)); } }
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)); }
public boolean hasPolygonChanges() { if (model.getPolygons().compareTo(serializePolygons()) != 0) return true; return false; }
public void syncPolygonChanges() { model.setPolygons(serializePolygons()); }
public void syncChanges() { model.setRed(layerColour.getRed()); model.setGreen(layerColour.getGreen()); model.setBlue(layerColour.getBlue()); model.setOpacity(((float) layerColour.getAlpha()) / 255f); }