Search in sources :

Example 1 with NotePadDialog

use of org.apache.hop.ui.hopgui.dialog.NotePadDialog in project hop by apache.

the class HopGuiPipelineGraph method newNote.

@GuiContextAction(id = "pipeline-graph-transform-10100-create-note", parentId = HopGuiPipelineContext.CONTEXT_ID, type = GuiActionType.Create, name = "i18n::HopGuiPipelineGraph.NoteAction.CreateNote.Name", tooltip = "i18n::HopGuiPipelineGraph.NoteAction.CreateNote.Tooltip", image = "ui/images/note-add.svg", category = "Basic", categoryOrder = "1")
public void newNote(HopGuiPipelineContext context) {
    selectionRegion = null;
    String title = BaseMessages.getString(PKG, "PipelineGraph.Dialog.NoteEditor.Title");
    NotePadDialog dd = new NotePadDialog(variables, hopShell(), title);
    NotePadMeta n = dd.open();
    if (n != null) {
        NotePadMeta npi = new NotePadMeta(n.getNote(), context.getClick().x, context.getClick().y, ConstUi.NOTE_MIN_SIZE, ConstUi.NOTE_MIN_SIZE, n.getFontName(), n.getFontSize(), n.isFontBold(), n.isFontItalic(), n.getFontColorRed(), n.getFontColorGreen(), n.getFontColorBlue(), n.getBackGroundColorRed(), n.getBackGroundColorGreen(), n.getBackGroundColorBlue(), n.getBorderColorRed(), n.getBorderColorGreen(), n.getBorderColorBlue());
        pipelineMeta.addNote(npi);
        hopGui.undoDelegate.addUndoNew(pipelineMeta, new NotePadMeta[] { npi }, new int[] { pipelineMeta.indexOfNote(npi) });
        adjustScrolling();
        updateGui();
    }
}
Also used : NotePadDialog(org.apache.hop.ui.hopgui.dialog.NotePadDialog) GuiContextAction(org.apache.hop.core.action.GuiContextAction)

Example 2 with NotePadDialog

use of org.apache.hop.ui.hopgui.dialog.NotePadDialog in project hop by apache.

the class HopGuiNotePadDelegate method newNote.

public void newNote(IVariables variables, AbstractMeta meta, int x, int y) {
    String title = BaseMessages.getString(PKG, "PipelineGraph.Dialog.NoteEditor.Title");
    NotePadDialog dd = new NotePadDialog(variables, hopGui.getShell(), title);
    NotePadMeta n = dd.open();
    if (n != null) {
        NotePadMeta npi = new NotePadMeta(n.getNote(), x, y, ConstUi.NOTE_MIN_SIZE, ConstUi.NOTE_MIN_SIZE, n.getFontName(), n.getFontSize(), n.isFontBold(), n.isFontItalic(), n.getFontColorRed(), n.getFontColorGreen(), n.getFontColorBlue(), n.getBackGroundColorRed(), n.getBackGroundColorGreen(), n.getBackGroundColorBlue(), n.getBorderColorRed(), n.getBorderColorGreen(), n.getBorderColorBlue());
        meta.addNote(npi);
        hopGui.undoDelegate.addUndoNew(meta, new NotePadMeta[] { npi }, new int[] { meta.indexOfNote(npi) });
        handler.updateGui();
    }
}
Also used : NotePadDialog(org.apache.hop.ui.hopgui.dialog.NotePadDialog) NotePadMeta(org.apache.hop.core.NotePadMeta)

Example 3 with NotePadDialog

use of org.apache.hop.ui.hopgui.dialog.NotePadDialog in project hop by apache.

the class HopGuiPipelineGraph method editNote.

private void editNote(NotePadMeta ni) {
    NotePadMeta before = ni.clone();
    String title = BaseMessages.getString(PKG, "PipelineGraph.Dialog.EditNote.Title");
    NotePadDialog dd = new NotePadDialog(variables, hopShell(), title, ni);
    NotePadMeta n = dd.open();
    if (n != null) {
        ni.setChanged();
        ni.setNote(n.getNote());
        ni.setFontName(n.getFontName());
        ni.setFontSize(n.getFontSize());
        ni.setFontBold(n.isFontBold());
        ni.setFontItalic(n.isFontItalic());
        // font color
        ni.setFontColorRed(n.getFontColorRed());
        ni.setFontColorGreen(n.getFontColorGreen());
        ni.setFontColorBlue(n.getFontColorBlue());
        // background color
        ni.setBackGroundColorRed(n.getBackGroundColorRed());
        ni.setBackGroundColorGreen(n.getBackGroundColorGreen());
        ni.setBackGroundColorBlue(n.getBackGroundColorBlue());
        // border color
        ni.setBorderColorRed(n.getBorderColorRed());
        ni.setBorderColorGreen(n.getBorderColorGreen());
        ni.setBorderColorBlue(n.getBorderColorBlue());
        ni.width = ConstUi.NOTE_MIN_SIZE;
        ni.height = ConstUi.NOTE_MIN_SIZE;
        NotePadMeta after = (NotePadMeta) ni.clone();
        hopGui.undoDelegate.addUndoChange(pipelineMeta, new NotePadMeta[] { before }, new NotePadMeta[] { after }, new int[] { pipelineMeta.indexOfNote(ni) });
        updateGui();
    }
}
Also used : NotePadDialog(org.apache.hop.ui.hopgui.dialog.NotePadDialog)

Example 4 with NotePadDialog

use of org.apache.hop.ui.hopgui.dialog.NotePadDialog in project hop by apache.

the class HopGuiWorkflowGraph method editNote.

protected void editNote(NotePadMeta notePadMeta) {
    NotePadMeta before = notePadMeta.clone();
    String title = BaseMessages.getString(PKG, "WorkflowGraph.Dialog.EditNote.Title");
    NotePadDialog dd = new NotePadDialog(variables, hopShell(), title, notePadMeta);
    NotePadMeta n = dd.open();
    if (n != null) {
        notePadMeta.setChanged();
        notePadMeta.setNote(n.getNote());
        notePadMeta.setFontName(n.getFontName());
        notePadMeta.setFontSize(n.getFontSize());
        notePadMeta.setFontBold(n.isFontBold());
        notePadMeta.setFontItalic(n.isFontItalic());
        // font color
        notePadMeta.setFontColorRed(n.getFontColorRed());
        notePadMeta.setFontColorGreen(n.getFontColorGreen());
        notePadMeta.setFontColorBlue(n.getFontColorBlue());
        // background color
        notePadMeta.setBackGroundColorRed(n.getBackGroundColorRed());
        notePadMeta.setBackGroundColorGreen(n.getBackGroundColorGreen());
        notePadMeta.setBackGroundColorBlue(n.getBackGroundColorBlue());
        // border color
        notePadMeta.setBorderColorRed(n.getBorderColorRed());
        notePadMeta.setBorderColorGreen(n.getBorderColorGreen());
        notePadMeta.setBorderColorBlue(n.getBorderColorBlue());
        hopGui.undoDelegate.addUndoChange(workflowMeta, new NotePadMeta[] { before }, new NotePadMeta[] { notePadMeta }, new int[] { workflowMeta.indexOfNote(notePadMeta) });
        notePadMeta.width = ConstUi.NOTE_MIN_SIZE;
        notePadMeta.height = ConstUi.NOTE_MIN_SIZE;
        updateGui();
    }
}
Also used : NotePadDialog(org.apache.hop.ui.hopgui.dialog.NotePadDialog)

Example 5 with NotePadDialog

use of org.apache.hop.ui.hopgui.dialog.NotePadDialog in project hop by apache.

the class HopGuiWorkflowGraph method newNote.

@GuiContextAction(id = "workflow-graph-new-note", parentId = HopGuiWorkflowContext.CONTEXT_ID, type = GuiActionType.Create, name = "i18n::HopGuiWorkflowGraph.ContextualAction.CreateNote.Text", tooltip = "i18n::HopGuiWorkflowGraph.ContextualAction.CreateNote.Tooltip", image = "ui/images/note-add.svg", category = "i18n::HopGuiWorkflowGraph.ContextualAction.Category.Basic.Text", categoryOrder = "1")
public void newNote(HopGuiWorkflowContext context) {
    String title = BaseMessages.getString(PKG, "WorkflowGraph.Dialog.EditNote.Title");
    NotePadDialog dd = new NotePadDialog(variables, hopShell(), title);
    NotePadMeta n = dd.open();
    if (n != null) {
        NotePadMeta npi = new NotePadMeta(n.getNote(), context.getClick().x, context.getClick().y, ConstUi.NOTE_MIN_SIZE, ConstUi.NOTE_MIN_SIZE, n.getFontName(), n.getFontSize(), n.isFontBold(), n.isFontItalic(), n.getFontColorRed(), n.getFontColorGreen(), n.getFontColorBlue(), n.getBackGroundColorRed(), n.getBackGroundColorGreen(), n.getBackGroundColorBlue(), n.getBorderColorRed(), n.getBorderColorGreen(), n.getBorderColorBlue());
        workflowMeta.addNote(npi);
        hopGui.undoDelegate.addUndoNew(workflowMeta, new NotePadMeta[] { npi }, new int[] { workflowMeta.indexOfNote(npi) });
        adjustScrolling();
        redraw();
    }
}
Also used : NotePadDialog(org.apache.hop.ui.hopgui.dialog.NotePadDialog) GuiContextAction(org.apache.hop.core.action.GuiContextAction)

Aggregations

NotePadDialog (org.apache.hop.ui.hopgui.dialog.NotePadDialog)5 GuiContextAction (org.apache.hop.core.action.GuiContextAction)2 NotePadMeta (org.apache.hop.core.NotePadMeta)1