001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.midp.chameleon;
028:
029: import javax.microedition.lcdui.Graphics;
030: import javax.microedition.lcdui.Command;
031: import javax.microedition.lcdui.CommandListener;
032: import javax.microedition.lcdui.ItemCommandListener;
033:
034: /**
035: * The ChamDisplayTunnel interface is a special interface which
036: * defines the relationship between Chameleon and the lcdui
037: * Display class. It exists to provide cross-package access
038: * from the Chameleon user interface library to the lcdui
039: * Display class.
040: */
041: public interface ChamDisplayTunnel {
042:
043: /**
044: * This method is used by Chameleon to paint the current Displayable.
045: *
046: * @param g the graphics context to paint with
047: */
048: public void callPaint(Graphics g);
049:
050: /**
051: * This method is used by Chameleon to schedule a paint event with
052: * the event scheduler. This will result in a subsequent paint()
053: * call to Chameleon on the event thread.
054: */
055: public void scheduleRepaint();
056:
057: /**
058: * This method is used by Chameleon to indicate that a screen
059: * command has been selected.
060: *
061: * @param cmd the Command which was selected
062: * @param listener the CommandListener which was established at
063: * the time the Command was added
064: */
065: public void callScreenListener(Command cmd, CommandListener listener);
066:
067: /**
068: * This method is used by Chameleon to indicate that an item
069: * command has been selected.
070: *
071: * @param cmd the Command which was selected
072: * @param listener the item CommandListener which was established at
073: * the time the Command was added
074: */
075: public void callItemListener(Command cmd,
076: ItemCommandListener listener);
077:
078: /**
079: * This method is used by Chameleon to invoke
080: * Displayable.sizeChanged() method.
081: *
082: * @param w the new width
083: * @param h the new height
084: */
085: public void callSizeChanged(int w, int h);
086:
087: /**
088: * This method is used by Chameleon to invoke
089: * Displayable.uCallScrollContent() method.
090: *
091: * @param scrollType scrollType
092: * @param thumbPosition
093: */
094: public void callScrollContent(int scrollType, int thumbPosition);
095:
096: /**
097: * Updates the scroll indicator.
098: */
099: public void updateScrollIndicator();
100: }
|