Class JaxoTabbedCanvasPanel
java.lang.Object
java.awt.event.MouseAdapter
net.sf.jaxodraw.gui.panel.JaxoTabbedCanvasPanel
- All Implemented Interfaces:
ActionListener, MouseListener, MouseMotionListener, MouseWheelListener, PropertyChangeListener, EventListener, JaxoLocalized
public class JaxoTabbedCanvasPanel
extends MouseAdapter
implements ActionListener, PropertyChangeListener, JaxoLocalized
A tabbed panel. This holds properties that are common for the whole application,
eg the collection of tabs, the canvas (which is unique for all tabs), etc.
- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionJaxoTabbedCanvasPanel(JaxoCommunicator panel, Component parent) Constructor: adds MouseListener and ChangeListener to the tabbedPane. -
Method Summary
Modifier and TypeMethodDescriptionvoidReturns an instance of the canvas.final JComponentgetRoot()Root component displaying current tabs and a way to switch between them.final JaxoTabReturn the currently active tab.final JaxoTabgetTabAt(int index) Returns the tab at given index.final intGets the current number of tabs.intGet the index of the given tab.final JaxoTabgetTabWithSaveFileName(String name) (An arbitrary) Tab with the given saveFileName, or 'null' if none exists.booleanIndicates whether antialiasing is active or not.final voidProcesses the right-click to show the popup menu on the canvas tab.voidopenOrImport(String fileName) Open given file (JaxoDraw or plugin based on extension) in a new tab.voidperformAction(int mode) Performs the action corresponding to the given mode.voidvoidsetAntialiasEnabled(boolean on) Switches antialiasing on or off.voidsetSelectedTab(JaxoTab value) Sets the given tab as currently selected.final voidUpdates the component with the current language as set in the preferences (JaxoPrefs.PREF_LANGUAGE).Methods inherited from class MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelMoved
-
Constructor Details
-
JaxoTabbedCanvasPanel
Constructor: adds MouseListener and ChangeListener to the tabbedPane.- Parameters:
panel- Instance of the main panelparent- the parent component of this panel.
-
-
Method Details
-
getCanvas
-
getRoot
Root component displaying current tabs and a way to switch between them.- Returns:
- The root component.
-
getTabCount
public final int getTabCount()Gets the current number of tabs.- Returns:
- The current number of tabs.
-
getTabAt
Returns the tab at given index.- Parameters:
index- The index of tab to get.- Returns:
- The tab
-
getTabIndex
Get the index of the given tab.- Parameters:
t- The tab.- Returns:
- The index of the tab.
-
getSelectedTab
-
setSelectedTab
Sets the given tab as currently selected.- Parameters:
value- True for selected.
-
getTabWithSaveFileName
-
updateLanguage
public final void updateLanguage()Updates the component with the current language as set in the preferences (JaxoPrefs.PREF_LANGUAGE).- Specified by:
updateLanguagein interfaceJaxoLocalized
-
performAction
public void performAction(int mode) Performs the action corresponding to the given mode.- Parameters:
mode- A mode as defined inJaxoConstants.
-
openOrImport
Open given file (JaxoDraw or plugin based on extension) in a new tab.- Parameters:
fileName- The file to open or import.
-
mousePressed
Processes the right-click to show the popup menu on the canvas tab.- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classMouseAdapter- Parameters:
e- The mouse event.
-
isAntialiasEnabled
public boolean isAntialiasEnabled()Indicates whether antialiasing is active or not.- Returns:
- True when antialiasing is active, false otherwise.
- Since:
- 2.1
-
setAntialiasEnabled
public void setAntialiasEnabled(boolean on) Switches antialiasing on or off.- Parameters:
on- A boolean variable that indicates whether antialising is on or not.- Since:
- 2.1
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener- Parameters:
e- the ActionEvent.
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-