org.grinvin.gui.components

Class GraphListComponent

Implemented Interfaces:
HasAccessControl, HasGraphList, HasSelectableGraphList, HasSelectableValues, MouseListener

public class GraphListComponent
extends JList
implements HasSelectableGraphList, HasAccessControl, MouseListener

Author:
adpeeter

Field Summary

protected GraphListModel
model

Constructor Summary

GraphListComponent(GraphListModel model)
GraphListComponent(GraphListModel model, ListSelectionModel selectionModel)
GraphListComponent(GraphListModel model, ListSelectionModel selectionModel, int dragOperations, int dropOperations)
GraphListComponent(GraphListModel model, int dragOperations, int dropOperations)

Method Summary

protected ListSelectionModel
createListSelectionModel()
void
deleteSelectedElements()
Delete currently selected elements.
int
getDragOperations()
int
getDropOperations()
GraphList
getGraphList()
Return the graph list model which is used by this component.
boolean
isReadOnly()
void
mouseClicked(MouseEvent e)
void
mouseEntered(MouseEvent e)
void
mouseExited(MouseEvent e)
void
mousePressed(MouseEvent e)
void
mouseReleased(MouseEvent e)
void
renameSelectedElement()
Rename currently selected element.
void
setIsReadOnly(boolean isReadOnly)
void
setPaintWatermark(boolean paintWatermark)
Configure whether to paint the watermark or not.
protected @Override
void paintComponent(Graphics g)
Adds a watermark to the list.

Field Details

model

protected GraphListModel model

Constructor Details

GraphListComponent

public GraphListComponent(GraphListModel model)

GraphListComponent

public GraphListComponent(GraphListModel model,
                          ListSelectionModel selectionModel)

GraphListComponent

public GraphListComponent(GraphListModel model,
                          ListSelectionModel selectionModel,
                          int dragOperations,
                          int dropOperations)

GraphListComponent

public GraphListComponent(GraphListModel model,
                          int dragOperations,
                          int dropOperations)

Method Details

createListSelectionModel

protected ListSelectionModel createListSelectionModel()

deleteSelectedElements

public void deleteSelectedElements()
Delete currently selected elements.

getDragOperations

public int getDragOperations()
Specified by:
getDragOperations in interface HasAccessControl

getDropOperations

public int getDropOperations()
Specified by:
getDropOperations in interface HasAccessControl

getGraphList

public GraphList getGraphList()
Return the graph list model which is used by this component.
Specified by:
getGraphList in interface HasGraphList

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface HasAccessControl

mouseClicked

public void mouseClicked(MouseEvent e)

mouseEntered

public void mouseEntered(MouseEvent e)

mouseExited

public void mouseExited(MouseEvent e)

mousePressed

public void mousePressed(MouseEvent e)

mouseReleased

public void mouseReleased(MouseEvent e)

renameSelectedElement

public void renameSelectedElement()
Rename currently selected element.

setIsReadOnly

public void setIsReadOnly(boolean isReadOnly)

setPaintWatermark

public void setPaintWatermark(boolean paintWatermark)

void paintComponent

protected @Override void paintComponent(Graphics g)
Adds a watermark to the list.