Class HexPane

All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, HexModelChangeListener

  • Field Details

  • Constructor Details

    • HexPane

      HexPane(HexModel model)
      Constructor.
      Parameters:
      model - HexModel instance.
  • Method Details

    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • paintInEdit

      private void paintInEdit(Graphics g, byte content, int x, int y)
    • getSelectedString

      private AttributedString getSelectedString(String str)
    • setDefault

      private void setDefault(Graphics g)
    • getIndexForPoint

      private int getIndexForPoint(Point point)
      Returns the index for a given point If there is any byte in there.
      Parameters:
      point - Point instance.
      Returns:
      index.
    • getPointForIndex

      private Point getPointForIndex(int index)
      Returns the starting point in the view for any index.
      Parameters:
      index - int.
      Returns:
      Point instance.
    • putInSelected

      private void putInSelected(int index)
      Puts an index in selected state or in other word it selects the byte of the index.
      Parameters:
      index -
    • fireSelectionChanged

      private void fireSelectionChanged(SelectEvent event)
    • fireHexValueChanged

      private void fireHexValueChanged(byte value, int index)
    • addSelectionChangeListener

      public void addSelectionChangeListener(SelectionChangeListener listener)
    • addHexChangeListeners

      public void addHexChangeListeners(HexChangeListener listener)
    • keyTyped

      public void keyTyped(KeyEvent keyEvent)
      Specified by:
      keyTyped in interface KeyListener
    • keyPressed

      public void keyPressed(KeyEvent keyEvent)
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent keyEvent)
      Specified by:
      keyReleased in interface KeyListener
    • mouseClicked

      public void mouseClicked(MouseEvent mouseEvent)
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent mouseEvent)
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent mouseEvent)
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent mouseEvent)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent mouseEvent)
      Specified by:
      mouseExited in interface MouseListener
    • mouseDragged

      public void mouseDragged(MouseEvent mouseEvent)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseMoved

      public void mouseMoved(MouseEvent mouseEvent)
      Specified by:
      mouseMoved in interface MouseMotionListener
    • isHexChar

      private static boolean isHexChar(char c)
    • getChars

      private char[] getChars(byte b)
    • getByte

      private byte getByte(char[] chars)
    • setSelected

      public void setSelected(int index)
    • hexModelChanged

      public void hexModelChanged(HexModelChangedEvent event)
      Specified by:
      hexModelChanged in interface HexModelChangeListener