public class HomeController extends java.lang.Object implements Controller
Constructor and Description |
---|
HomeController(Home home,
HomeApplication application,
ViewFactory viewFactory)
Creates the controller of home view.
|
HomeController(Home home,
HomeApplication application,
ViewFactory viewFactory,
ContentManager contentManager)
Creates the controller of home view.
|
HomeController(Home home,
UserPreferences preferences,
ViewFactory viewFactory)
Creates the controller of home view.
|
HomeController(Home home,
UserPreferences preferences,
ViewFactory viewFactory,
ContentManager contentManager)
Creates the controller of home view.
|
Modifier and Type | Method and Description |
---|---|
void |
about()
Displays about dialog.
|
void |
addFurnitureToGroup()
Adds the selected furniture in catalog to the selected group and selects it.
|
void |
addHomeFurniture()
Adds the selected furniture in catalog to home and selects it.
|
void |
attachView(View view)
Attaches the given
view to home view. |
void |
checkUpdates(boolean displayOnlyIfNewUpdates)
Checks if some application or libraries updates are available.
|
void |
close()
Manages home close operation.
|
void |
close(java.lang.Runnable postCloseTask)
Manages home close operation.
|
void |
createPhoto()
Controls the creation of photo-realistic images.
|
void |
createPhotos()
Controls the creation of multiple photo-realistic images at the stored cameras locations.
|
void |
createTransferData(TransferableView.TransferObserver observer,
TransferableView.DataType... dataTypes)
Returns the transfer data matching the requested types.
|
void |
createVideo()
Controls the creation of 3D videos.
|
void |
cut(java.util.List<? extends Selectable> items)
Deletes items and post a cut operation to undo support.
|
void |
delete()
Deletes the selection in the focused component.
|
void |
deleteBackgroundImage()
Deletes home background image and posts and posts an undoable operation.
|
void |
deleteCameras()
Prompts stored cameras in home to be deleted and deletes the ones selected by the user.
|
void |
deleteRecentHomes()
Deletes the list of recent homes in user preferences.
|
void |
detachView(View view)
Detaches the given
view from home view. |
void |
disableMagnetism()
Disables magnetism in preferences.
|
void |
drop(java.util.List<? extends Selectable> items,
float dx,
float dy)
Adds items to home, moves them of (dx, dy)
and posts a drop operation to undo support.
|
void |
drop(java.util.List<? extends Selectable> items,
View destinationView,
float dx,
float dy)
Adds items to home, moves them of (dx, dy)
and posts a drop operation to undo support.
|
void |
drop(java.util.List<? extends Selectable> items,
View destinationView,
Level level,
float dx,
float dy,
java.lang.Float dz)
Adds items to home, moves them of (dx, dy, dz) delta vector
and posts a drop operation to undo support.
|
void |
drop(java.util.List<? extends Selectable> items,
View destinationView,
Selectable beforeItem)
Adds items to home before the given item
and posts a drop operation to undo support.
|
void |
dropFiles(java.util.List<java.lang.String> importableModels,
float dx,
float dy)
Adds imported models to home, moves them of (dx, dy)
and post a drop operation to undo support.
|
void |
editPreferences()
Edits preferences and changes them if user agrees.
|
protected void |
enableActionsBoundToSelection()
Enables or disables action bound to selection.
|
void |
enableMagnetism()
Enables magnetism in preferences.
|
void |
enablePasteAction()
Enables clipboard paste action if clipboard isn't empty.
|
protected void |
enableSelectAllAction()
Enables select all action if home isn't empty.
|
void |
exit()
Controls application exit.
|
void |
exportToCSV()
Controls the export of the furniture list of current home to a CSV file.
|
void |
exportToOBJ()
Controls the export of the 3D view of current home to an OBJ file.
|
void |
exportToSVG()
Controls the export of the current home plan to a SVG file.
|
void |
focusedViewChanged(View focusedView)
Updates actions when focused view changed.
|
ContentManager |
getContentManager()
Returns the content manager of this controller.
|
FurnitureCatalogController |
getFurnitureCatalogController()
Returns the furniture catalog controller managed by this controller.
|
FurnitureController |
getFurnitureController()
Returns the furniture controller managed by this controller.
|
HomeController3D |
getHomeController3D()
Returns the controller of home 3D view.
|
PlanController |
getPlanController()
Returns the controller of home plan.
|
java.util.List<java.lang.String> |
getRecentHomes()
Returns a list of displayable recent homes.
|
protected javax.swing.undo.UndoableEditSupport |
getUndoableEditSupport()
Returns the undoable edit support managed by this controller.
|
java.lang.String |
getVersion()
Returns the version of the application for display purpose.
|
HomeView |
getView()
Returns the view associated with this controller.
|
void |
help()
Displays help window.
|
void |
hideBackgroundImage()
Hides the home background image.
|
void |
importBackgroundImage()
Displays the wizard that helps to import home background image.
|
void |
importFurniture()
Imports furniture to the catalog or home depending on the focused view.
|
void |
importFurnitureLibrary()
Imports a furniture library chosen by the user.
|
void |
importFurnitureLibrary(java.lang.String furnitureLibraryName)
Imports a given furniture library.
|
void |
importLanguageLibrary()
Imports a language library chosen by the user.
|
void |
importLanguageLibrary(java.lang.String languageLibraryName)
Imports a given language library.
|
void |
importTexture()
Imports a texture to the texture catalog.
|
void |
importTexturesLibrary()
Imports a textures library chosen by the user.
|
void |
importTexturesLibrary(java.lang.String texturesLibraryName)
Imports a given textures library.
|
void |
modifyBackgroundImage()
Displays the wizard that helps to change home background image.
|
void |
modifySelectedFurniture()
Modifies the selected furniture of the focused view.
|
void |
newHome()
Creates a new home and adds it to application home list.
|
void |
newHomeFromExample()
Creates a new home from an example chosen by the user.
|
void |
open()
Opens a home.
|
void |
open(java.lang.String homeName)
Opens a given
homeName home. |
void |
paste(java.util.List<? extends Selectable> items)
Adds items to home and posts a paste operation to undo support.
|
void |
pasteStyle()
Paste the style of the item in clipboard on selected items compatible with it.
|
void |
pasteToGroup()
Paste the furniture in clipboard to the selected group in home.
|
void |
previewPrint()
Controls the print preview.
|
void |
print()
Controls the print of this home.
|
void |
printToPDF()
Controls the print of this home in a PDF file.
|
void |
redo()
Redoes last undone operation.
|
void |
save()
Saves the home managed by this controller.
|
void |
saveAndCompress()
Saves the home managed by this controller and compresses it.
|
void |
saveAs()
Saves the home managed by this controller with a different name.
|
protected void |
saveAs(HomeRecorder.Type recorderType,
java.lang.Runnable postSaveTask)
Saves the home managed by this controller with a different name.
|
void |
saveAsAndCompress()
Saves the home managed by this controller with a different name and compresses it.
|
void |
selectAll()
Selects everything in the focused component.
|
void |
setHomeProperty(java.lang.String propertyName,
java.lang.String propertyValue)
Controls the change of value of a property in home.
|
void |
setMode(PlanController.Mode mode)
Displays a tip message dialog depending on the given mode and
sets the active mode of the plan controller.
|
void |
setupPage()
Controls page setup.
|
void |
setVisualProperty(java.lang.String propertyName,
java.lang.Object propertyValue)
Deprecated.
setVisualProperty should be replaced by a call to
setHomeProperty(String, String) to ensure the property can be easily saved and read. |
void |
showBackgroundImage()
Shows the home background image.
|
void |
storeCamera()
Prompts a name for the current camera and stores it in home.
|
void |
undo()
Undoes last operation.
|
void |
zoomIn()
Zooms in in plan.
|
void |
zoomOut()
Zooms out in plan.
|
public HomeController(Home home, HomeApplication application, ViewFactory viewFactory, ContentManager contentManager)
home
- the home edited by this controller and its view.application
- the instance of current application.viewFactory
- a factory able to create views.contentManager
- the content manager of the application.public HomeController(Home home, HomeApplication application, ViewFactory viewFactory)
home
- the home edited by this controller and its view.application
- the instance of current application.viewFactory
- a factory able to create views.public HomeController(Home home, UserPreferences preferences, ViewFactory viewFactory)
home
- the home edited by this controller and its view.preferences
- the preferences of the application.viewFactory
- a factory able to create views.public HomeController(Home home, UserPreferences preferences, ViewFactory viewFactory, ContentManager contentManager)
home
- the home edited by this controller and its view.preferences
- the preferences of the application.viewFactory
- a factory able to create views.contentManager
- the content manager of the application.public HomeView getView()
getView
in interface Controller
public ContentManager getContentManager()
public FurnitureCatalogController getFurnitureCatalogController()
public FurnitureController getFurnitureController()
public PlanController getPlanController()
public HomeController3D getHomeController3D()
protected final javax.swing.undo.UndoableEditSupport getUndoableEditSupport()
protected void enableActionsBoundToSelection()
public void enablePasteAction()
protected void enableSelectAllAction()
public void addHomeFurniture()
public void addFurnitureToGroup()
public void modifySelectedFurniture()
public void importLanguageLibrary()
public void importLanguageLibrary(java.lang.String languageLibraryName)
public void importFurniture()
public void importFurnitureLibrary()
public void importFurnitureLibrary(java.lang.String furnitureLibraryName)
public void importTexture()
public void importTexturesLibrary()
public void importTexturesLibrary(java.lang.String texturesLibraryName)
public void undo()
public void redo()
public void cut(java.util.List<? extends Selectable> items)
public void paste(java.util.List<? extends Selectable> items)
public void drop(java.util.List<? extends Selectable> items, float dx, float dy)
public void drop(java.util.List<? extends Selectable> items, View destinationView, float dx, float dy)
public void drop(java.util.List<? extends Selectable> items, View destinationView, Level level, float dx, float dy, java.lang.Float dz)
public void drop(java.util.List<? extends Selectable> items, View destinationView, Selectable beforeItem)
public void dropFiles(java.util.List<java.lang.String> importableModels, float dx, float dy)
public void pasteToGroup()
public void pasteStyle()
public void createTransferData(TransferableView.TransferObserver observer, TransferableView.DataType... dataTypes)
public void delete()
public void focusedViewChanged(View focusedView)
public void selectAll()
public void newHome()
public void newHomeFromExample()
public void open()
open dialog
in view, reads the home from the chosen name and adds it to application home list.public void open(java.lang.String homeName)
homeName
home.public java.util.List<java.lang.String> getRecentHomes()
public java.lang.String getVersion()
public void deleteRecentHomes()
public void close()
confirm
in view whether home should be saved. Once home is actually saved,
home is removed from application homes list.public void close(java.lang.Runnable postCloseTask)
confirm
in view whether home should be saved. Once home is actually saved,
home is removed from application homes list and postCloseTask
is called if it's not null
.public void save()
saveAs
method.public void saveAs()
save dialog
in view,
and saves home with the chosen name if any.protected void saveAs(HomeRecorder.Type recorderType, java.lang.Runnable postSaveTask)
postCloseTask
is called if it's not null
.public void saveAndCompress()
public void saveAsAndCompress()
save dialog
in view,
and saves home with the chosen name if any.public void exportToCSV()
public void exportToSVG()
public void exportToOBJ()
public void createPhotos()
public void createPhoto()
public void createVideo()
public void setupPage()
public void previewPrint()
public void print()
public void printToPDF()
public void exit()
prompted
in view whether he wants
to discard his modifications or not.public void editPreferences()
public void enableMagnetism()
public void disableMagnetism()
public void setMode(PlanController.Mode mode)
public void importBackgroundImage()
public void modifyBackgroundImage()
public void hideBackgroundImage()
public void showBackgroundImage()
public void deleteBackgroundImage()
public void zoomOut()
public void zoomIn()
public void storeCamera()
public void deleteCameras()
public void detachView(View view)
view
from home view.public void attachView(View view)
view
to home view.public void help()
public void about()
public void setVisualProperty(java.lang.String propertyName, java.lang.Object propertyValue)
setVisualProperty
should be replaced by a call to
setHomeProperty(String, String)
to ensure the property can be easily saved and read.public void setHomeProperty(java.lang.String propertyName, java.lang.String propertyValue)
public void checkUpdates(boolean displayOnlyIfNewUpdates)
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License