public class JaxoTabbedCanvasPanel extends java.awt.event.MouseAdapter implements JaxoLocalized
Constructor and Description |
---|
JaxoTabbedCanvasPanel(JaxoMainPanel panel)
Constructor: adds MouseListener and ChangeListener to the tabbedPane.
|
Modifier and Type | Method and Description |
---|---|
void |
fileEvent(int i)
Executes the methods defined as file events in
JaxoConstants . |
javax.swing.JComponent |
getRoot()
Root component displaying current tabs and a way to
switch between them.
|
JaxoTab |
getSelectedTab()
Return the currently active tab.
|
int |
getSelectedTabIndex()
Returns the index of 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.
|
void |
initTabs()
Initialize tabs (show a default untitled tab if there is not).
|
void |
initTabs(java.lang.String initialFileName)
Initialize tabs (open 'initialFile', or, if it fails, and there is
no tab, show a default untitled tab.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Processes the right-click to show the popup menu on the canvas tab.
|
void |
open(java.lang.String fileName)
Open given file in a new tab.
|
void |
openOrImport(java.lang.String fileName)
Open given file (JaxoDraw or plugin based on extension) in a new tab.
|
void |
renameTab()
Brings up a dialog to rename the current tab.
|
void |
setSelectedTab(JaxoTab value)
Sets the given tab as currently selected.
|
void |
setSelectedTabIndex(int value)
Sets the tab at given index as currently active.
|
void |
updateLanguage()
Updates the component with the current language as set in the
preferences (
JaxoPrefs.PREF_LANGUAGE ). |
public JaxoTabbedCanvasPanel(JaxoMainPanel panel)
panel
- Instance of the main panelpublic void initTabs()
public void initTabs(java.lang.String initialFileName)
initialFileName
- The file to open.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 final int getSelectedTabIndex()
public void setSelectedTab(JaxoTab value)
value
- True for selected.public void setSelectedTabIndex(int value)
value
- The index.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 final void fileEvent(int i)
JaxoConstants
.i
- Integer specifying the file event.public void renameTab()
public void open(java.lang.String fileName)
fileName
- The file to open.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.Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.