Package kiyut.citra.canvas
Class FXContextManager
- java.lang.Object
-
- kiyut.citra.canvas.AbstractFXContext
-
- kiyut.citra.canvas.FXContextManager
-
- All Implemented Interfaces:
FXContext
public class FXContextManager extends AbstractFXContext
Global or application wide singleton instances implementation of FXContext- Author:
- Kiyut
-
-
Field Summary
-
Fields inherited from class kiyut.citra.canvas.AbstractFXContext
canvas, filter, filterMode, interactor, selectionStroke1, selectionStroke2, selectionStrokePaint1, selectionStrokePaint2, tool, toolOverlayFillPaint, toolOverlayStrokePaint
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FXContextManagergetInstance()Returns the single instance.org.openide.util.LookupgetLookup()Return this object lookupvoidopen(File file)Open Image File as the specified file paramvoidrevert()Reopen the Image FilevoidsaveAs()Save As the current active canvas, and update the file locationvoidsaveCopy()Save Copy the current active canvas, does not update the file locationprotected voidsaveImpl(BufferedImage image, boolean copy)Save the supplied image.voidsetFilter(FXFilter filter)Overidden to put filter into the lookup-
Methods inherited from class kiyut.citra.canvas.AbstractFXContext
getCanvas, getFilter, getSelectionStroke1, getSelectionStroke2, getSelectionStrokePaint1, getSelectionStrokePaint2, getTool, getToolOverlayFillPaint, getToolOverlayStrokePaint, isFilterMode, setCanvas, setFilterMode, setTool
-
-
-
-
Method Detail
-
getInstance
public static FXContextManager getInstance()
Returns the single instance.- Returns:
- The single instance.
-
getLookup
public org.openide.util.Lookup getLookup()
Return this object lookup- Returns:
- Lookup
-
setFilter
public void setFilter(FXFilter filter)
Overidden to put filter into the lookup- Specified by:
setFilterin interfaceFXContext- Overrides:
setFilterin classAbstractFXContext
-
open
public void open(File file)
Open Image File as the specified file param- Parameters:
file-File- See Also:
revert()
-
revert
public void revert()
Reopen the Image File- See Also:
open(File)
-
saveAs
public void saveAs()
Save As the current active canvas, and update the file location- See Also:
saveCopy(),saveImpl(BufferedImage, boolean)
-
saveCopy
public void saveCopy()
Save Copy the current active canvas, does not update the file location- See Also:
saveAs(),saveImpl(BufferedImage, boolean)
-
saveImpl
protected void saveImpl(BufferedImage image, boolean copy)
Save the supplied image. It delegated to the ImageWriterDialog- Parameters:
image-BufferedImagecopy- true (saveCopy) or false (saveAs)- See Also:
saveAs(),saveCopy()
-
-