/*
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 */
package com.sun.glass.ui;

import java.util.Map;
import java.util.HashMap;

public abstract class Pen {
    private View view;

    protected void setView(final View view) {
        this.view = view;
    }

    public View getView() {
        return this.view;
    }

    public abstract Map getCapabilities();
    public Map addCapability(Map capabilities, Object key, Object value) {
        if (capabilities == null) {
            capabilities = new HashMap();
        }
        capabilities.put(key, value);
        return capabilities;
    }

    public abstract void paint(long time, int width, int height);

    public void begin() {
        getView().lock();
    }

    public void end() {
        getView().unlock(true);
    }
}
