com.cycling74.max
Class MaxWindow

java.lang.Object
  extended by com.cycling74.max.MaxWindow

public class MaxWindow
extends java.lang.Object

MaxWindow is a reference to the window containing a patcher. This can be used in conjunction with MaxPatcher and MaxBox to dynamically modify and create patchers on the fly. The interface exposed is very similar to the functionality exposed by the js javascript external and thus much of that documentation for that external is applicable well. There is no public constructor for MaxWindow. MaxWindows created / gotten via the MaxPatcher class. created on 22-Jun-2004


Constructor Summary
protected MaxWindow(long p_wind)
           
 
Method Summary
 void close()
          close the window.
 boolean equals(java.lang.Object o)
           
 int[] getLocation()
           
 MaxPatcher getPatcher()
           
 java.lang.String getPatcherClass()
           
 int[] getSize()
           
 java.lang.String getTitle()
          Get the title of the window as displayed in the title bar.
 boolean hasClose()
           
 boolean hasGrow()
           
 int hashCode()
           
 boolean hasHorizontalScroll()
           
 boolean hasTitleBar()
           
 boolean hasVerticalScroll()
           
 boolean hasZoom()
           
 boolean isDirty()
           
 boolean isVisible()
           
 void setClose(boolean hasclose)
          Set whether or not the window has a close widget
 void setDirty(boolean isdirty)
          Set whether or not this window and its patcher should be treated as dirty.
 void setFloat(boolean floating)
          Set whether or not the window is "floating"
 void setGrow(boolean hasgrow)
          Set whether or not the window has a grow widget
 void setLocation(int x1, int y1, int x2, int y2)
          Set the bounding rect of the window.
 void setSize(int width, int height)
          Set the size of the window
 void setTitle(java.lang.String title)
          Set the title of the window in the title bar.
 void setTitleBar(boolean hastitlebar)
          Set whether or not the window has a titlebar
 void setVisible(boolean b)
          Set whether or not the window is visible
 void setZoom(boolean haszoom)
          Set whether or not the window has a zoom widget
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxWindow

protected MaxWindow(long p_wind)
Method Detail

isVisible

public boolean isVisible()
Returns:
true if window is visible on the screen

setVisible

public void setVisible(boolean b)
Set whether or not the window is visible


getTitle

public java.lang.String getTitle()
Get the title of the window as displayed in the title bar. If there are any brackets, as in the case of subpatchers, they are removed.


setTitle

public void setTitle(java.lang.String title)
Set the title of the window in the title bar.


hasHorizontalScroll

public boolean hasHorizontalScroll()
Returns:
true if the window has a horizontal scrollbar

hasVerticalScroll

public boolean hasVerticalScroll()
Returns:
true if the window has a vertical scrollbar

hasZoom

public boolean hasZoom()
Returns:
true if the window has a zoom widget

hasTitleBar

public boolean hasTitleBar()
Returns:
true if the window has a title bar

hasClose

public boolean hasClose()
Returns:
true if the window has a close widget

hasGrow

public boolean hasGrow()
Returns:
true if the window has a resize widget

getSize

public int[] getSize()
Returns:
2 element int array containing width and height of the window

setSize

public void setSize(int width,
                    int height)
Set the size of the window


getLocation

public int[] getLocation()
Returns:
4 element array containing absolute screen coordinates of the window's bounding box x1,y1,x2,y2

setLocation

public void setLocation(int x1,
                        int y1,
                        int x2,
                        int y2)
Set the bounding rect of the window.


getPatcher

public MaxPatcher getPatcher()
Returns:
the MaxPatcher object for which this window is a host.

getPatcherClass

public java.lang.String getPatcherClass()
Returns:
the max class of the patcher for which this window is a host.

isDirty

public boolean isDirty()
Returns:
whether or not this window or its patcher have changed since opened.

setDirty

public void setDirty(boolean isdirty)
Set whether or not this window and its patcher should be treated as dirty. When a window is dirty the user is asked if they wish to save changes when it is closed.


setZoom

public void setZoom(boolean haszoom)
Set whether or not the window has a zoom widget


setTitleBar

public void setTitleBar(boolean hastitlebar)
Set whether or not the window has a titlebar


setClose

public void setClose(boolean hasclose)
Set whether or not the window has a close widget


setGrow

public void setGrow(boolean hasgrow)
Set whether or not the window has a grow widget


setFloat

public void setFloat(boolean floating)
Set whether or not the window is "floating"


close

public void close()
close the window. USE AT PERIL.


equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object