+ /**
+ * Get the raw (unprocessed) image.
+ *
+ * @return the image
+ */
+ public BufferedImage getImage() {
+ return originalImage;
+ }
+
+ /**
+ * Set the raw image, and reprocess to make the visible image.
+ *
+ * @param image the new image
+ */
+ public void setImage(final BufferedImage image) {
+ this.originalImage = image;
+ this.image = null;
+ sizeToImage(true);
+ }
+
+ /**
+ * Get the visible (processed) image.
+ *
+ * @return the image that is currently on screen
+ */
+ public BufferedImage getVisibleImage() {
+ return image;
+ }
+
+ /**
+ * Get the scaling strategy.
+ *
+ * @return Scale.NONE, Scale.STRETCH, etc.
+ */
+ public Scale getScaleType() {
+ return scale;
+ }
+
+ /**
+ * Set the scaling strategy.
+ *
+ * @param scale Scale.NONE, Scale.STRETCH, etc.
+ */
+ public void setScaleType(final Scale scale) {
+ this.scale = scale;
+ this.image = null;
+ sizeToImage(true);
+ }
+
+ /**
+ * Get the scale factor.
+ *
+ * @return the scale factor
+ */
+ public double getScaleFactor() {
+ return scaleFactor;
+ }
+
+ /**
+ * Set the scale factor. 1.0 means no scaling.
+ *
+ * @param scaleFactor the new scale factor
+ */
+ public void setScaleFactor(final double scaleFactor) {
+ this.scaleFactor = scaleFactor;
+ image = null;
+ sizeToImage(true);
+ }
+
+ /**
+ * Get the rotation, as degrees.
+ *
+ * @return the rotation in degrees
+ */
+ public int getRotation() {
+ switch (clockwise) {
+ case 0:
+ return 0;
+ case 1:
+ return 90;
+ case 2:
+ return 180;
+ case 3:
+ return 270;
+ default:
+ // Don't know how this happened, but fix it.
+ clockwise = 0;
+ image = null;
+ sizeToImage(true);
+ return 0;
+ }
+ }
+
+ /**
+ * Set the rotation, as degrees clockwise.
+ *
+ * @param rotation 0, 90, 180, or 270
+ */
+ public void setRotation(final int rotation) {
+ switch (rotation) {
+ case 0:
+ clockwise = 0;
+ break;
+ case 90:
+ clockwise = 1;
+ break;
+ case 180:
+ clockwise = 2;
+ break;
+ case 270:
+ clockwise = 3;
+ break;
+ default:
+ // Don't know how this happened, but fix it.
+ clockwise = 0;
+ break;
+ }
+
+ image = null;
+ sizeToImage(true);
+ }
+