MasterScan  Lab_Matlab_control Master Branch
List of all members | Protected Properties | Methods | Protected Methods
topsFigure Class Reference
Inheritance diagram for topsFigure:
Inheritance graph
[legend]

Protected Properties

Property name = 'Tower of Psych'
 The top-level container for Tower of Psych GUIs. More...
 
Property backgroundColor = [0.98 0.98 0.96]
 the color to use for backgrounds
 
Property midgroundColor = [0.3 0.2 0.1]
 the color to use for midgrounds or secondary text
 
Property foregroundColor = [0 0 0]
 the color to use for foregrounds or primary text
 
Property colors = puebloColors(9)
 color map to use for alternate foreground colors
 
Property fontName = 'Helvetica'
 default font typeface to use for text
 
Property fontSize = 12
 default font size to use for text
 
Property fig
 the Matlab figure window
 
Property figureDiv = [8 92]
 how to divide the figure area between button and main panels
 
Property mainPanel
 the figure area reserved for content panels
 
Property buttonPanel
 the figure area reserved for buttons
 
Property buttons = []
 array of button graphics handles
 
Property currentItem
 the "current item" in use in the GUI
 
Property currentItemName
 name to give the "current item"
 

Methods

self topsFigure (name, varargin)
 Open an new topsGUIUtilities. More...
 
 delete (self)
 Close the Matlab figure and clear handle and graphics objects.
 
 addButton (self, name, pressFunction)
 Add a button to the button panel. More...
 
fig makeFigure (self)
 Make a Matlab figure with a certain look and feel.
 
panel makeUIPanel (self, parent)
 Make a Matlab uipanel with a certain look and feel. More...
 
ax makeAxes (self, parent)
 Make a Matlab axes with a certain look and feel. More...
 
table makeUITable (self, parent, selectFunction, editFunction)
 Make a uitable with a certain look and feel. More...
 
tree container makeUITree (self, parent, rootNode, expandFunction, selectFunction)
 Make a uitree with a certain look and feel. More...
 
makeEditField (self, parent, editFunction)
 Make a uicontrol text edit field with a certain look and feel. More...
 
makeButton (self, parent, pressFunction)
 Make a uicontrol button with a certain look and feel. More...
 
widget container jWidget jContainer makeHTMLWidget (self, parent)
 Make a widget capable of displaying HTML content. More...
 
 setName (self, name)
 Choose the name to display in the figure title bar. More...
 
 setCurrentItem (self, currentItem, currentItemName)
 Choose the current item and tell panels to update. More...
 
 usePanels (self, panels, yDiv, xDiv)
 Choose the content panels to use in this GUI. More...
 
 refresh (self)
 Tell each content panel to refresh its contents. More...
 
 currentItemOpenAsFile (self)
 Try to open the current item as a file.
 
fig currentItemOpenGUI (self)
 View details of the current item.
 
 currentItemToWorkspace (self)
 Send the current item to the Command Window workspace.
 
 setPanels (self, panels)
 Store references to content panels in the Matlab figure. More...
 
panels getPanels (self)
 Retrieve references to content panels from the Matlab figure. More...
 

Protected Methods

 initialize (self)
 Create and arrange fresh components.
 
 repositionButtons (self)
 Organize buttons in the button panel with even spacing.
 

Constructor

◆ topsFigure()

self topsFigure ( name  ,
varargin   
)

Open an new topsGUIUtilities.

Parameters
nameoptional name to give the figure.
vararginoptional property-value pairs to set

Opens a new topsFigure and initializes components. If name is provided, displays name in the title bar. If varargin is provided, it should contain property-value pairs to set before initialization.

Methods

◆ addButton()

addButton ( self  ,
name  ,
pressFunction   
)

Add a button to the button panel.

Parameters
namestring to display on the button
pressFunctioncallback for button presses

Creates a new button with the given name and pressFunction behavior. Places the button in the buttonPanel for this figure and automatically rearranges all the buttons.

◆ makeUIPanel()

panel makeUIPanel ( self  ,
parent   
)

Make a Matlab uipanel with a certain look and feel.

Parameters
parentfigure or uipanel to hold the new uipanel

Returns a new uipanel which is a child of the given parent, or mainPanel if parent is omitted. At first, the uipanel is not visible.

◆ makeAxes()

ax makeAxes ( self  ,
parent   
)

Make a Matlab axes with a certain look and feel.

Parameters
parentfigure or uipanel to hold the new uipanel

Returns a new axes handle which is a child of the given parent, or mainPanel if parent is omitted.

◆ makeUITable()

table makeUITable ( self  ,
parent  ,
selectFunction  ,
editFunction   
)

Make a uitable with a certain look and feel.

Parameters
parentfigure or uipanel to hold the new uitable
selectFunctioncallback for selected table cell
editFunctioncallback for edited table cell

Returns a new uitable which is a child of the given parent, or mainPanel if parent is omitted.

selectFunction determines what happens when the user selects a cell in the table. selectFunction should expect the uitable object as the first input a struct of selection event data as the second input.

editFunction determines what happens when the user edits a cell in the table. editFunction should expect the uitable object as the first input a struct of edit event data as the second input.

◆ makeUITree()

tree container makeUITree ( self  ,
parent  ,
rootNode  ,
expandFunction  ,
selectFunction   
)

Make a uitree with a certain look and feel.

Parameters
parentfigure or uipanel to hold the new uitree
rootNodeuitreenode which is the topmost tree node
expandFunctioncallback for expanding tree nodes
selectFunctioncallback for selected tree node

Makes a new uitree object which can present data in a heirarchical fashion. The uitree is wrapped in a container which can scroll as needed. The container is a child of the given parent, or mainPanel if parent is omitted.

rootNode represents the top of the heirarchical presentation. It must be a uitreenode.

expandFunction determines what data are presented beneath each tree node, when each node is expanded. expandFunction must expect a uitreenode object as the first input and a value associated with that node as the second input. expandFunction must return one output, which is an array of new uitreenode objects to add under the expanded node, or else [].

selectFunction determines what happens when the user selects a node. selectFunction should expect a uitreenode object as the first input and a value associated with that node as the second input.

◆ makeEditField()

e makeEditField ( self  ,
parent  ,
editFunction   
)

Make a uicontrol text edit field with a certain look and feel.

Parameters
parentfigure or uipanel to hold the text field.
editFunctioncallback to handle edited text

Returns a new uicontrol edit text field which is a child of the given parent, or mainPanel if parent is omitted.

editFunction determines what happens when the user finishes editing text. editFunction should expect a uicontrol object as the first input and a struct of event data as the second input.

◆ makeButton()

b makeButton ( self  ,
parent  ,
pressFunction   
)

Make a uicontrol button with a certain look and feel.

Parameters
parentfigure or uipanel to hold the new button.
pressFunctioncallback for pressed button

Returns a new uicontrol pushbutton which is a child of the given parent, or mainPanel if parent is omitted.

pressFunction determines what happens when the user presses the button. pressFunction should expect a uicontrol object as the first input and a struct of event data as the second input.

◆ makeHTMLWidget()

widget container jWidget jContainer makeHTMLWidget ( self  ,
parent   
)

Make a widget capable of displaying HTML content.

Parameters
parentfigure or uipanel to hold the new widget

Makes a new HTML widget which is a child of the given parent, or mainPanel if parent is omitted. The widget is wrapped in a container which can scroll as needed. Both a Matlab graphics handle and a Java object are returned, for both the widget and the container. The four outputs are returned following order:

  • widget handle
  • container handle
  • widget Java object
  • container Java object.

◆ setName()

setName ( self  ,
name   
)

Choose the name to display in the figure title bar.

Parameters
namestring name of the figure

Assigns name to this object and updates the Matlab figure window.

◆ setCurrentItem()

setCurrentItem ( self  ,
currentItem  ,
currentItemName   
)

Choose the current item and tell panels to update.

Parameters
currentItemthe new current item
currentItemNamename to use for the current item

Assigns currentItem and currentItemName to this figure and any panels. currentItemName is optional. If omitted, currentItemName defaults to its present value.

◆ usePanels()

usePanels ( self  ,
panels  ,
yDiv  ,
xDiv   
)

Choose the content panels to use in this GUI.

Parameters
panels2D cell array of topsPanel objects
yDivarray specifying how to arrange panels vertically
xDivarray specifying how to arrange panels horizontally

Assigns the given panels to work with this topsFigure to make a GUI. panels should be a 2D cell array, where the rows and columns indicate how the panels should be layed out graphically. The first row and first column correspond to the bottom left corner of the main panel. Where panels contains empty elements, the main panel is left blank. If panels contains duplicate adjacent elements, the duplicated panel is stretched to fill more than one row or column.

By default, the main panel is divided evenly into rows and columns. xDiv and yDiv may specify uneven divisions. xDiv should have one element for each column of panels, and yDiv should have one element for each row. The elemets of xDiv or yDiv specify the relative width or height of each column or row, respectively.

Sets the Position of each panel's uipanel for the given layout, and makes each panel Visible.

◆ refresh()

refresh ( self  )

Tell each content panel to refresh its contents.

Refreshes the appearance of this figure. By default, also invokes refresh() on child topsPanels.

◆ setPanels()

setPanels ( self  ,
panels   
)

Store references to content panels in the Matlab figure.

Parameters
panelscell array of topsPanel objects

Sets the given panels to the UserData property of this topsFigures's fig. panels can be retrieved with getPanels();

◆ getPanels()

panels getPanels ( self  )

Retrieve references to content panels from the Matlab figure.

Returns a cell array of topsPanel objects that was stored in UserData property of this topsFigures's fig, via setPanels().

Properties and Events

◆ name

Property name = 'Tower of Psych'
protected

The top-level container for Tower of Psych GUIs.

topsFigure manages a Matlab figure window for use by Tower od Psych Graphical User Interfaces (GUIs). Each topsFigure can contain one or more content panels which show custom plots and data, and a few buttons.

topsFigure also defines a standard "look and feel" for GUIs, by choosing things like how to lay out GUI components and what colors they should be.

With the help of its content panels, topsFigure keeps track of a "current item". This may be any Matlab variable, such as a Tower of Psych object or a piece of data, which was most recently viewed or used through the GUI. The various content panels can work together by all using the same "current item". topsFigure provides buttons for sending the current item to the Command Window workspace and for viewing the current item in more detail. GUI name to display in the figure title bar


The documentation for this class was generated from the following file: