/** * Creates and returns a cell state for the given cell. * * @param cell * Cell for which a new state should be created. * @return Returns a new state for the given cell. */ public mxCellState createState(Object cell) { return new mxCellState(this, cell, graph.getCellStyle(cell)); }
/** * Creates and returns a cell state for the given cell. * * @param cell * Cell for which a new state should be created. * @return Returns a new state for the given cell. */ public mxCellState createState(Object cell) { return new mxCellState(this, cell, graph.getCellStyle(cell)); }
/** * Returns the constant true. This does not use the cloneable field to * return a value for a given cell, it is simply a hook for subclassers * to disallow cloning of individual cells. */ public boolean isCellCloneable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsCloneable() && mxUtils.isTrue(style, mxConstants.STYLE_CLONEABLE, true); }
/** * Returns the constant true. This does not use the cloneable field to * return a value for a given cell, it is simply a hook for subclassers * to disallow cloning of individual cells. */ public boolean isCellCloneable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsCloneable() && mxUtils.isTrue(style, mxConstants.STYLE_CLONEABLE, true); }
/** * Returns true if the given cell is movable. This implementation always * returns true. * * @param cell Cell whose movable state should be returned. * @return Returns true if the cell is movable. */ public boolean isCellDeletable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsDeletable() && mxUtils.isTrue(style, mxConstants.STYLE_DELETABLE, true); }
/** * Returns true if the size of the given cell should automatically be * updated after a change of the label. This implementation returns * autoSize for all given cells or checks if the cell style does specify * mxConstants.STYLE_AUTOSIZE to be 1. * * @param cell Cell that should be resized. * @return Returns true if the size of the given cell should be updated. */ public boolean isAutoSizeCell(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isAutoSizeCells() || mxUtils.isTrue(style, mxConstants.STYLE_AUTOSIZE, false); }
/** * Returns true if the given cell is expandable. This implementation * returns true if the cell has at least one child and its style * does not specify mxConstants.STYLE_FOLDABLE to be 0. * * @param cell <mxCell> whose expandable state should be returned. * @return Returns true if the given cell is expandable. */ public boolean isCellFoldable(Object cell, boolean collapse) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return model.getChildCount(cell) > 0 && mxUtils.isTrue(style, mxConstants.STYLE_FOLDABLE, true); }
/** * Returns true if the given cell is movable. This implementation always * returns true. * * @param cell Cell whose movable state should be returned. * @return Returns true if the cell is movable. */ public boolean isCellDeletable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsDeletable() && mxUtils.isTrue(style, mxConstants.STYLE_DELETABLE, true); }
/** * Returns true if the size of the given cell should automatically be * updated after a change of the label. This implementation returns * autoSize for all given cells or checks if the cell style does specify * mxConstants.STYLE_AUTOSIZE to be 1. * * @param cell Cell that should be resized. * @return Returns true if the size of the given cell should be updated. */ public boolean isAutoSizeCell(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isAutoSizeCells() || mxUtils.isTrue(style, mxConstants.STYLE_AUTOSIZE, false); }
/** * Returns true if the given cell is expandable. This implementation * returns true if the cell has at least one child and its style * does not specify mxConstants.STYLE_FOLDABLE to be 0. * * @param cell <mxCell> whose expandable state should be returned. * @return Returns true if the given cell is expandable. */ public boolean isCellFoldable(Object cell, boolean collapse) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return model.getChildCount(cell) > 0 && mxUtils.isTrue(style, mxConstants.STYLE_FOLDABLE, true); }
/** * Returns true if the given cell is movable. This implementation returns editable. * * @param cell Cell whose editable state should be returned. * @return Returns true if the cell is editable. */ public boolean isCellEditable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsEditable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_EDITABLE, true); }
/** * Returns true if the given cell is movable. This implementation returns editable. * * @param cell Cell whose editable state should be returned. * @return Returns true if the cell is editable. */ public boolean isCellEditable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsEditable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_EDITABLE, true); }
/** * Returns true if the given cell is movable. This implementation * returns movable. * * @param cell Cell whose movable state should be returned. * @return Returns true if the cell is movable. */ public boolean isCellMovable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsMovable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_MOVABLE, true); }
/** * Returns true if the given cell is movable. This implementation * returns movable. * * @param cell Cell whose movable state should be returned. * @return Returns true if the cell is movable. */ public boolean isCellMovable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsMovable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_MOVABLE, true); }
/** * Returns true if the given cell is resizable. This implementation returns * cellsSizable for all cells. * * @param cell Cell whose resizable state should be returned. * @return Returns true if the cell is sizable. */ public boolean isCellResizable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsResizable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_RESIZABLE, true); }
/** * Returns true if the given cell is bendable. This implementation returns * bendable. This is used in mxElbowEdgeHandler to determine if the middle * handle should be shown. * * @param cell Cell whose bendable state should be returned. * @return Returns true if the cell is bendable. */ public boolean isCellBendable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsBendable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_BENDABLE, true); }
/** * Returns true if the given cell is resizable. This implementation returns * cellsSizable for all cells. * * @param cell Cell whose resizable state should be returned. * @return Returns true if the cell is sizable. */ public boolean isCellResizable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsResizable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_RESIZABLE, true); }
/** * Returns true if the given cell is bendable. This implementation returns * bendable. This is used in mxElbowEdgeHandler to determine if the middle * handle should be shown. * * @param cell Cell whose bendable state should be returned. * @return Returns true if the cell is bendable. */ public boolean isCellBendable(Object cell) { mxCellState state = view.getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : getCellStyle(cell); return isCellsBendable() && !isCellLocked(cell) && mxUtils.isTrue(style, mxConstants.STYLE_BENDABLE, true); }
/** * Returns true if the given cell is horizontal. If the given cell is not a * swimlane, then the <horizontal> value is returned. */ protected boolean isCellHorizontal(Object cell) { if (graph.isSwimlane(cell)) { mxCellState state = graph.getView().getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : graph.getCellStyle(cell); return mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true); } return !isHorizontal(); }
/** * Returns true if the given cell is horizontal. If the given cell is not a * swimlane, then the <horizontal> value is returned. */ protected boolean isCellHorizontal(Object cell) { if (graph.isSwimlane(cell)) { mxCellState state = graph.getView().getState(cell); Map<String, Object> style = (state != null) ? state.getStyle() : graph.getCellStyle(cell); return mxUtils.isTrue(style, mxConstants.STYLE_HORIZONTAL, true); } return !isHorizontal(); }