Package sig.engine

Class Panel

  • All Implemented Interfaces:
    java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible

    public class Panel
    extends javax.swing.JPanel
    implements java.lang.Runnable, java.awt.event.KeyListener
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int button  
      static javax.swing.JFrame f  
      double nanaX  
      double nanaY  
      static Panel p  
      int[] pixel  
      static java.awt.RenderingHints RENDERHINTS  
      static long scaleTime  
      static long TIME  
      static int UPDATE_LOOP_FRAMERATE  
      static long UPDATE_LOOP_NANOTIME  
      static double UPDATE_MULT  
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Constructor Summary

      Constructors 
      Constructor Description
      Panel​(javax.swing.JFrame f)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void Clear​(Color col)  
      void Draw​(int x, int y, Color col)  
      void Draw_Animated_Sprite​(double x, double y, AnimatedSprite sprite, double frameIndex)  
      void Draw_Animated_Sprite​(double x, double y, AnimatedSprite sprite, double frameIndex, Color col, Transform transform)  
      void Draw_Animated_Sprite_Partial_Ext​(double x, double y, double xOffset, double yOffset, double w, double h, AnimatedSprite sprite, double frameIndex, Color col, Transform transform)  
      void Draw_Circle​(int x, int y, int radius, Color col)  
      void Draw_Circle​(int x, int y, int radius, Color col, byte mask)  
      void Draw_Line​(int x1, int y1, int x2, int y2, Color col)  
      void Draw_Rect​(double x, double y, double w, double h, Color col)  
      void Draw_Sprite​(double x, double y, Sprite sprite)  
      void Draw_Sprite​(double x, double y, Sprite sprite, Color col)  
      void Draw_Sprite​(double x, double y, Sprite sprite, Transform transform)  
      void Draw_Sprite_Partial​(double x, double y, double xOffset, double yOffset, double w, double h, Sprite sprite, double frame_index, Color col, Transform transform)  
      void Draw_Sprite_Partial_Ext​(double x, double y, double xOffset, double yOffset, double w, double h, Sprite sprite, double frame_index, Color col, Transform transform)  
      void Draw_Sprite_Partial_Ext​(double x, double y, double xOffset, double yOffset, double w, double h, Sprite sprite, Color col, Transform transform)  
      void Draw_Text​(double x, double y, java.lang.String s, Font f)  
      void Draw_Text_Ext​(double x, double y, java.lang.String s, Font f, Color col)  
      void Draw_Triangle​(double x1, double y1, double x2, double y2, double x3, double y3, Color col)  
      void Fill_Circle​(int x, int y, int radius, Color col)  
      void Fill_Rect​(double x, double y, double w, double h, Color col)  
      void Fill_Triangle​(double x1, double y1, double x2, double y2, double x3, double y3, Color col)  
      void FillCircle​(double center_x, double center_y, double r, Color col)  
      void FillOval​(double center_x, double center_y, double w, double h, Color col)  
      void FillPolygon​(double x_offset, double y_offset, Color col, java.util.List<Point<java.lang.Integer>> points)  
      void FillTexturedPolygon​(java.util.List<Point<java.lang.Double>> vPoints, java.util.List<Point<java.lang.Double>> vTex, java.util.List<Color> vColour, Sprite sprTex, PolygonStructure structure)  
      void FillTexturedTriangle​(java.util.List<Point<java.lang.Double>> vPoints, java.util.List<Point<java.lang.Double>> vTex, java.util.List<Color> vColour, Sprite sprTex)  
      protected static java.awt.image.ColorModel getCompatibleColorModel()
      Get Best Color model available for current screen.
      boolean imageUpdate​(java.awt.Image image, int a, int b, int c, int d, int e)
      Overrides ImageObserver.imageUpdate.
      void init()
      Call it after been visible and after resizes.
      static void InitializeEngine​(JavaProjectTemplate instance)  
      void keyPressed​(java.awt.event.KeyEvent e)  
      void keyReleased​(java.awt.event.KeyEvent e)  
      void keyTyped​(java.awt.event.KeyEvent e)  
      void paintComponent​(java.awt.Graphics g)  
      void render()
      Do your draws in here !! pixel is your canvas!
      void run()  
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • pixel

        public int[] pixel
      • nanaX

        public double nanaX
      • nanaY

        public double nanaY
      • button

        public int button
      • RENDERHINTS

        public static java.awt.RenderingHints RENDERHINTS
      • TIME

        public static long TIME
      • scaleTime

        public static long scaleTime
      • p

        public static Panel p
      • f

        public static javax.swing.JFrame f
    • Constructor Detail

      • Panel

        public Panel​(javax.swing.JFrame f)
    • Method Detail

      • getCompatibleColorModel

        protected static java.awt.image.ColorModel getCompatibleColorModel()
        Get Best Color model available for current screen.
        Returns:
        color model
      • init

        public void init()
        Call it after been visible and after resizes.
      • paintComponent

        public void paintComponent​(java.awt.Graphics g)
        Overrides:
        paintComponent in class javax.swing.JComponent
      • imageUpdate

        public boolean imageUpdate​(java.awt.Image image,
                                   int a,
                                   int b,
                                   int c,
                                   int d,
                                   int e)
        Overrides ImageObserver.imageUpdate. Always return true, assuming that imageBuffer is ready to go when called
        Specified by:
        imageUpdate in interface java.awt.image.ImageObserver
        Overrides:
        imageUpdate in class java.awt.Component
      • render

        public void render()
        Do your draws in here !! pixel is your canvas!
      • FillCircle

        public void FillCircle​(double center_x,
                               double center_y,
                               double r,
                               Color col)
      • FillOval

        public void FillOval​(double center_x,
                             double center_y,
                             double w,
                             double h,
                             Color col)
      • FillPolygon

        public void FillPolygon​(double x_offset,
                                double y_offset,
                                Color col,
                                java.util.List<Point<java.lang.Integer>> points)
      • Draw

        public void Draw​(int x,
                         int y,
                         Color col)
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent e)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent e)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • Draw_Text

        public void Draw_Text​(double x,
                              double y,
                              java.lang.String s,
                              Font f)
      • Draw_Text_Ext

        public void Draw_Text_Ext​(double x,
                                  double y,
                                  java.lang.String s,
                                  Font f,
                                  Color col)
      • Draw_Line

        public void Draw_Line​(int x1,
                              int y1,
                              int x2,
                              int y2,
                              Color col)
      • Fill_Rect

        public void Fill_Rect​(double x,
                              double y,
                              double w,
                              double h,
                              Color col)
      • Draw_Sprite

        public void Draw_Sprite​(double x,
                                double y,
                                Sprite sprite)
      • Draw_Animated_Sprite

        public void Draw_Animated_Sprite​(double x,
                                         double y,
                                         AnimatedSprite sprite,
                                         double frameIndex)
      • Draw_Sprite

        public void Draw_Sprite​(double x,
                                double y,
                                Sprite sprite,
                                Color col)
      • Draw_Sprite

        public void Draw_Sprite​(double x,
                                double y,
                                Sprite sprite,
                                Transform transform)
      • Draw_Animated_Sprite

        public void Draw_Animated_Sprite​(double x,
                                         double y,
                                         AnimatedSprite sprite,
                                         double frameIndex,
                                         Color col,
                                         Transform transform)
      • Draw_Sprite_Partial

        public void Draw_Sprite_Partial​(double x,
                                        double y,
                                        double xOffset,
                                        double yOffset,
                                        double w,
                                        double h,
                                        Sprite sprite,
                                        double frame_index,
                                        Color col,
                                        Transform transform)
      • Draw_Sprite_Partial_Ext

        public void Draw_Sprite_Partial_Ext​(double x,
                                            double y,
                                            double xOffset,
                                            double yOffset,
                                            double w,
                                            double h,
                                            Sprite sprite,
                                            Color col,
                                            Transform transform)
      • Draw_Animated_Sprite_Partial_Ext

        public void Draw_Animated_Sprite_Partial_Ext​(double x,
                                                     double y,
                                                     double xOffset,
                                                     double yOffset,
                                                     double w,
                                                     double h,
                                                     AnimatedSprite sprite,
                                                     double frameIndex,
                                                     Color col,
                                                     Transform transform)
      • Draw_Sprite_Partial_Ext

        public void Draw_Sprite_Partial_Ext​(double x,
                                            double y,
                                            double xOffset,
                                            double yOffset,
                                            double w,
                                            double h,
                                            Sprite sprite,
                                            double frame_index,
                                            Color col,
                                            Transform transform)
      • Draw_Rect

        public void Draw_Rect​(double x,
                              double y,
                              double w,
                              double h,
                              Color col)
      • Draw_Triangle

        public void Draw_Triangle​(double x1,
                                  double y1,
                                  double x2,
                                  double y2,
                                  double x3,
                                  double y3,
                                  Color col)
      • Fill_Triangle

        public void Fill_Triangle​(double x1,
                                  double y1,
                                  double x2,
                                  double y2,
                                  double x3,
                                  double y3,
                                  Color col)
      • FillTexturedTriangle

        public void FillTexturedTriangle​(java.util.List<Point<java.lang.Double>> vPoints,
                                         java.util.List<Point<java.lang.Double>> vTex,
                                         java.util.List<Color> vColour,
                                         Sprite sprTex)
      • Draw_Circle

        public void Draw_Circle​(int x,
                                int y,
                                int radius,
                                Color col)
      • Draw_Circle

        public void Draw_Circle​(int x,
                                int y,
                                int radius,
                                Color col,
                                byte mask)
      • Fill_Circle

        public void Fill_Circle​(int x,
                                int y,
                                int radius,
                                Color col)
      • FillTexturedPolygon

        public void FillTexturedPolygon​(java.util.List<Point<java.lang.Double>> vPoints,
                                        java.util.List<Point<java.lang.Double>> vTex,
                                        java.util.List<Color> vColour,
                                        Sprite sprTex,
                                        PolygonStructure structure)
      • Clear

        public void Clear​(Color col)