public class JaxoTabbedCanvasPanel extends java.awt.event.MouseAdapter implements java.awt.event.ActionListener, java.beans.PropertyChangeListener, JaxoLocalized
Constructor and Description |
---|
JaxoTabbedCanvasPanel(JaxoCommunicator panel,
java.awt.Component parent)
Constructor: adds MouseListener and ChangeListener to the tabbedPane.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
JaxoDrawingArea |
getCanvas()
Returns an instance of the canvas.
|
javax.swing.JComponent |
getRoot()
Root component displaying current tabs and a way to
switch between them.
|
JaxoTab |
getSelectedTab()
Return the currently active tab.
|
JaxoTab |
getTabAt(int index)
Returns the tab at given index.
|
int |
getTabCount()
Gets the current number of tabs.
|
int |
getTabIndex(JaxoTab t)
Get the index of the given tab.
|
JaxoTab |
getTabWithSaveFileName(java.lang.String name)
(An arbitrary) Tab with the given saveFileName, or 'null' if
none exists.
|
boolean |
isAntialiasEnabled()
Indicates whether antialiasing is active or not.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Processes the right-click to show the popup menu on the canvas tab.
|
void |
openOrImport(java.lang.String fileName)
Open given file (JaxoDraw or plugin based on extension) in a new tab.
|
void |
performAction(int mode)
Performs the action corresponding to the given mode.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
setAntialiasEnabled(boolean on)
Switches antialiasing on or off.
|
void |
setSelectedTab(JaxoTab value)
Sets the given tab as currently selected.
|
void |
updateLanguage()
Updates the component with the current language as set in the
preferences (
JaxoPrefs.PREF_LANGUAGE ). |
public JaxoTabbedCanvasPanel(JaxoCommunicator panel, java.awt.Component parent)
panel
- Instance of the main panelparent
- the parent component of this panel.public JaxoDrawingArea getCanvas()
public final javax.swing.JComponent getRoot()
public final int getTabCount()
public final JaxoTab getTabAt(int index)
index
- The index of tab to get.public int getTabIndex(JaxoTab t)
t
- The tab.public final JaxoTab getSelectedTab()
public void setSelectedTab(JaxoTab value)
value
- True for selected.public final JaxoTab getTabWithSaveFileName(java.lang.String name)
name
- The save file name of the tab.public final void updateLanguage()
JaxoPrefs.PREF_LANGUAGE
).updateLanguage
in interface JaxoLocalized
public void performAction(int mode)
mode
- A mode as defined in JaxoConstants
.public void openOrImport(java.lang.String fileName)
fileName
- The file to open or import.public final void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
e
- The mouse event.public boolean isAntialiasEnabled()
public void setAntialiasEnabled(boolean on)
on
- A boolean variable that indicates whether antialising is on or not.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- the ActionEvent.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.