Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.virtuosotechnologies.asaph.standardgui
Class SongBlockEditor  view SongBlockEditor download SongBlockEditor.java

java.lang.Object
  extended bycom.virtuosotechnologies.asaph.standardgui.SongBlockEditor

class SongBlockEditor
extends java.lang.Object

The song block editor


Nested Class Summary
(package private)  class SongBlockEditor.BlockUndoHelper
           
 
Field Summary
private  com.virtuosotechnologies.asaph.model.SongBlock block_
           
private  SongBodyEditor bodyEditor_
           
private  BodyEditorSize curSize_
           
private  java.util.List lineEditors_
           
private  java.util.List lineEditorSizes_
           
private  java.util.List lineEditorYs_
           
private  SongBodyEditorPane pane_
           
 
Constructor Summary
(package private) SongBlockEditor(SongBodyEditorPane pane, SongBodyEditor bodyEditor, com.virtuosotechnologies.asaph.model.SongBlock block)
          Constructor
 
Method Summary
(package private)  boolean canInsertChordMarkingHere()
           
(package private)  void doComment(boolean comment)
           
(package private)  void doCopy(boolean remove)
           
(package private)  void doDeleteSelection(boolean backspace)
           
private  void doEnter()
           
(package private)  void doInsert()
           
private  void doMergeWithPreviousBlock()
           
(package private)  void doPaste()
           
(package private)  void doSelectAll()
           
(package private)  void doShift(int shift)
           
private  int findLineForPoint(float y, boolean forceBetween)
          Utility determining where a mouse press happened.
(package private)  SongBodyEditor getBodyEditor()
           
(package private)  int getLineIndex(SongLineEditor lineEditor)
          Get the index of this line
(package private)  SongLineEditor getNthLine(int n)
          Get the nth line
(package private)  java.awt.geom.Rectangle2D getSelectionBounds(EditorSelection selection, boolean blink, float x, float y)
          Get the update rectangle for the current selection.
(package private)  BodyEditorSize getSize()
          Get the size of the editor
(package private)  void handleKey(java.awt.event.KeyEvent ev, float x)
          Handle key typed events
(package private)  void handleMouseDragged(java.awt.event.MouseEvent ev, float x, float y)
          Handle mouse-drag events
(package private)  boolean handleMousePressed(java.awt.event.MouseEvent ev, float x, float y, int containerBlock)
          Handle mouse-down events
(package private)  void handleMouseReleased(java.awt.event.MouseEvent ev, float x, float y)
          Handle mouse-up events
(package private)  boolean hasAtLeastOneLine()
          Returns true if this block contains at least one line
(package private)  void paint(java.awt.Graphics2D g2d, float x, float y, java.awt.Rectangle clipBounds, boolean select, boolean containsSelect)
          Draw
(package private)  void rebuild(boolean refresh)
          Rebuild according to the current model and settings
(package private)  void selectBottom()
          Select the bottom of the block.
(package private)  void selectDefault()
          Select default.
(package private)  void selectInBottomLine(float x)
          Move the caret to the bottom line.
(package private)  void selectInNextLine(float x)
          Move the caret to the next line.
(package private)  void selectInPreviousLine(float x)
          Move the caret to the previous line.
(package private)  void selectInTopLine(float x)
          Move the caret to the top line.
(package private)  void selectTop()
          Select the top of the block.
(package private)  void setLineSize(SongLineEditor lineEditor, BodyEditorSize size, boolean refresh)
          Resize for a block
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

block_

private com.virtuosotechnologies.asaph.model.SongBlock block_

pane_

private SongBodyEditorPane pane_

bodyEditor_

private SongBodyEditor bodyEditor_

lineEditors_

private java.util.List lineEditors_

lineEditorSizes_

private java.util.List lineEditorSizes_

lineEditorYs_

private java.util.List lineEditorYs_

curSize_

private BodyEditorSize curSize_
Constructor Detail

SongBlockEditor

SongBlockEditor(SongBodyEditorPane pane,
                SongBodyEditor bodyEditor,
                com.virtuosotechnologies.asaph.model.SongBlock block)
Constructor

Method Detail

getSize

BodyEditorSize getSize()
Get the size of the editor


rebuild

void rebuild(boolean refresh)
Rebuild according to the current model and settings


getBodyEditor

SongBodyEditor getBodyEditor()

getLineIndex

int getLineIndex(SongLineEditor lineEditor)
Get the index of this line


getNthLine

SongLineEditor getNthLine(int n)
Get the nth line


setLineSize

void setLineSize(SongLineEditor lineEditor,
                 BodyEditorSize size,
                 boolean refresh)
Resize for a block


paint

void paint(java.awt.Graphics2D g2d,
           float x,
           float y,
           java.awt.Rectangle clipBounds,
           boolean select,
           boolean containsSelect)
Draw


getSelectionBounds

java.awt.geom.Rectangle2D getSelectionBounds(EditorSelection selection,
                                             boolean blink,
                                             float x,
                                             float y)
Get the update rectangle for the current selection. Returns a Rectangle2D, or null for no selection.


hasAtLeastOneLine

boolean hasAtLeastOneLine()
Returns true if this block contains at least one line


selectDefault

void selectDefault()
Select default. Should be called only when the user drills in from the body level using the keyboard.


selectTop

void selectTop()
Select the top of the block. Should be called from the body only when the user navigates from the previous block.


selectBottom

void selectBottom()
Select the bottom of the block. Should be called from the body only when the user navigates from the next block.


selectInPreviousLine

void selectInPreviousLine(float x)
Move the caret to the previous line. We expect this to be called from the current line because the user is navigating up using the keyboard.


selectInNextLine

void selectInNextLine(float x)
Move the caret to the next line. We expect this to be called from the current line because the user is navigating down using the keyboard.


selectInTopLine

void selectInTopLine(float x)
Move the caret to the top line. We expect this to be called from the body, after the selection has been cleared.


selectInBottomLine

void selectInBottomLine(float x)
Move the caret to the bottom line. We expect this to be called from the body, after the selection has been cleared.


handleMousePressed

boolean handleMousePressed(java.awt.event.MouseEvent ev,
                           float x,
                           float y,
                           int containerBlock)
Handle mouse-down events


handleMouseDragged

void handleMouseDragged(java.awt.event.MouseEvent ev,
                        float x,
                        float y)
Handle mouse-drag events


handleMouseReleased

void handleMouseReleased(java.awt.event.MouseEvent ev,
                         float x,
                         float y)
Handle mouse-up events


handleKey

void handleKey(java.awt.event.KeyEvent ev,
               float x)
Handle key typed events


doCopy

void doCopy(boolean remove)

doPaste

void doPaste()

doInsert

void doInsert()

doComment

void doComment(boolean comment)

doDeleteSelection

void doDeleteSelection(boolean backspace)

doShift

void doShift(int shift)

canInsertChordMarkingHere

boolean canInsertChordMarkingHere()

doSelectAll

void doSelectAll()

doEnter

private void doEnter()

doMergeWithPreviousBlock

private void doMergeWithPreviousBlock()

findLineForPoint

private int findLineForPoint(float y,
                             boolean forceBetween)
Utility determining where a mouse press happened. If the hit is between lines, the nonnegative position is returned. If the hit is on a line, -1-index is returned.