Skip to content

Commit

Permalink
Merge pull request #415 from jonburgin/master
Browse files Browse the repository at this point in the history
Added methods to WebcamPanel to make custom painters a little more practical.
  • Loading branch information
sarxos committed Nov 16, 2015
2 parents 4e26313 + be5d902 commit 287addb
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,39 @@ public boolean isStarted() {
return started.get();
}

/**
* This method returns the current draw mode, mainly used by custom painters
* @return
*/
public DrawMode getDrawMode(){
return this.drawMode;
}

/**
* This method sets the drawmode
* @param drawMode
*/
public void setDrawMode(DrawMode drawMode){
this.drawMode = drawMode;
}

/**
* Indicates whether the panel is in an error state
* @return true if the panel has an error present
*/
public boolean isErrored(){
return errored;
}

/**
* Hints for rendering, mainly used for custom painters
* @return the stored RenderingHints
*/
public Map<RenderingHints.Key, Object> getImageRenderingHints() {
return imageRenderingHints;
}

@Deprecated//appropriate for binary, but not enum
public boolean isFitArea() {
return drawMode == DrawMode.FIT;
}
Expand All @@ -1029,6 +1062,7 @@ public boolean isFitArea() {
*
* @param fitArea the fit area mode enabled or disabled
*/
@Deprecated//appropriate for binary, but not enum
public void setFitArea(boolean fitArea) {
this.drawMode = fitArea ? DrawMode.FIT : DrawMode.NONE;
}
Expand All @@ -1039,6 +1073,7 @@ public void setFitArea(boolean fitArea) {
*
* @param fillArea shall image be resided to fill panel area
*/
@Deprecated//appropriate for binary, but not enum
public void setFillArea(boolean fillArea) {
this.drawMode = fillArea ? DrawMode.FILL : DrawMode.NONE;
}
Expand All @@ -1050,6 +1085,7 @@ public void setFillArea(boolean fillArea) {
*
* @return True if image is being resized, false otherwise
*/
@Deprecated//appropriate for binary, but not enum
public boolean isFillArea() {
return drawMode == DrawMode.FILL;
}
Expand Down

0 comments on commit 287addb

Please sign in to comment.