How to make a mask border

I just started using flash again for the first time in years and it has changed a lot. I was not very good at it when I was using it back when but I just made a little animation and I need to make a mask border around the canvas. I have multiple layers and folders and I want it all masked so that you can not see anything outside the canvas. Can anyone help me with this. And Please talk like you are talking to a retard cause I am not to far off right now.

if you're doing this in the authoring environment (as opposed to using actionscript), create a rectangular fill with width x height = stage width x stage height in a new layer above all other layers.  right click that layer and click mask.
now, with every layer in your project that's not indented below the mask layer, left click on the layer and slowly drag upwards a few pixels until you see a hatched line segment between the layer you're dragging and the layer above.  then release the layer and it should be indented indicating it will be masked.

Similar Messages

  • How to make a round border around my picture?

    I am trying to design a logo that would fit into the center of a Frisbie, yet I cannot figure out how to make a round border around the picture. I have tried using the eliptical tool, and have also tried using the cookie cutter. The only option I can get to work with the eliptical tool, is the feather, yet I can't change the pixel number for some reason, so it just makes a thin circle around the picture. I thought I could cut and paste it, but the copy and cut options were grayed out and didn't work. When I used the cookie cutter, it made a nice border, and I pasted the picture into it, but, there are four sections that need to be filled in with the background color and the paintbucket didn't work in those spaces (they are the gray and white checked areas. (the picture ends up looking like a rectangle inside of a circle). So I made a new blank file and filled it in with the color of the picture's background, hoping to use the cookie cutter tool around the picture that was now pasted into the new blank file (I chose another color for the round border) and I used the cookie cutter around the picture, but when it was finished, the whole picture ended up being white. All I want to do is to make a border around a picture (a round border). Nothing I have done has worked though. What am I doing wrong, or what are some other options for trying to do this? Thanks.

    Here is a simple way to add a border. Select the item, add a blank layer, choose the border size and color and the Outside option:
    Here is the result:
    Note that you don't even need to do the Stroke on a blank layer. You can Stroke directly on the picture layer. However having the blank layer preserves the picture in case you want to start again with different Stroke options.
    If this is not what you are looking to do, please clarify.

  • How to make the mask of an image

    I want to make the mask of an image by converting all non-white pixels of the image into black and leaving the white pixels unchanged. How to do this in Photoshop?
    Thanks.

    One method among many:
    Use the magic wand tool with 'Contiguous' unchecked. Select one of the white areas. You will probably have to play with the Tolerance setting until you get only the pixels you want.
    Next use Select > Inverse and you will have all the non-white pixels selected. From there you can edit in Quick Mask mode or make an Alpha Channel. Or even just Edit > Fill and select black for the fill at that point (if I understand what you're trying to do).
    Hope this helps.
    OldBob

  • How to make clipping mask with text and vector pattern?

    Hey there guys, any help would be greatly appreciated. Im making a logo for a client and am having a nightmare of a time trying to properly use the clipping masks in illustrator CS5. I copied and pasted the  logo I made behind itself with a different color just for a drop shadow-like effect. And now I'm trying to apply this diagonal line pattern I created over top the "shadow" I made to give it some texture.
    Here's an example of what I'm going for, only imagine the line pattern on the text instead of banner

    Eric,
    As I (mis)understand it, you can either keep the Type live (or outline it) and:
    1) Create one copy of the pattern for each Type object (this will give you the opportunity of having different(ly coloured) patterns;
    2) For each Type object, select the type object and one of the patterns and Object>Clipping Path>Make;
    or you can:
    1) Select both Type objects and Type>Create Outlines, then Object>Compound Path>Make;
    2) Select the compound object and the pattern and Object>Clipping Path>Make.

  • How to make a clipping mask in this particular case?

    Okay, Just to begin I know how to make a clipping mask, but for the case that I'm going to present right now I just can't figure out what mistake I am doing (if any). However I am a beginner.
    http://vector.tutsplus.com/tutorials/illustration/how-to-create-a-medieval-paper-scroll/
    In the link to above tutorial on how to make a medieval scrol I'm stuck at step 25 and would be glad to anyone who helped.
    As said in step 25 that expand the appearance of the scroll and select the two then clip the mask. In th above picture I have just selected the scroll to show how it looks.
    Now as you can see in the image below I have expanded the appearance of the paper scroll. Then I selected the paper scrol and the yellowish green grunge background placed below it. And the moment I hit Ctrl+7 (in windows) or Command+7 (in Mac) to make a clipping mask the error that showed up has been highlighted.
    One more thing, I have clipped masks before too in the same tutorial given above but I don't know what has gone wrong for me in this step.
    Please help.
    Signed,
    Awais Rauf

    Why would you want a clipping mask? I don’t see a reason for it.
    However, for what you want I would use the Pathfinder panel to combine all the paths into one shape. First use the ungroup and release compound commands a few times each, to make sure you have nothing grouped. Then press the top left button in the Pathfinder p[panel. This should produce one closed path that just surrounds the scroll.

  • How to make a border

    Hello,
    I'm new to Mac & iWeb, I've d/l'd the iWebFAQ although it doesn't state anything on how to place a border around my content on my website. Nor can I find how to make a background under my website.
    Any assistance will be appreciated.
    ...Zorba118

    Click on whatever you want a border around and open the Inspector in iWeb and then click on the 5th along and then you have the option of using a Line or Picture Frame - whatever you want. If you want a border, then use the line option and you can change the colour and thickness of it around what you want.
    For background colours, open the Inspector and go to Page and Layout and then you can change the background page colour and the browser colour.

  • How to make a gradient on two paths

    Hello,
    I am fairly new to Illustrator, although have used Photoshop, Fireworks and DW to some degree in the past.
    In CS4, I am trying to make a country map with different counties or states.  Using the map of the UK and including Wales, Scotland, and some of the counties as an example.  I need to portray the whole country, but only highlight a specific part of the land, along a train line and so quickly fade away to almost transparent in the further edges.
    Using the pen tool I have traced the country and county borders as paths. I then used the fill tool to make each country, or sea, a different colour.  Now I want to fade the edges of my map away to transparent to bring attention to the middle.  I have drawn another path on top and beyond the edge of the artwork and tried to make a transparency overlay and gradient in this path to make it fade to the edges.  However, this does not work as I had hoped for three reasons.
    1) the darkest edge of my 'fade path' does not blend into the country below but is quite an obvious line.
    2) the gradient is a different colour as it sits on top of other paths of different colours.
    3) the gradient is linear, from top to north, of radial, from a certain spot.  I need the gradient to flow out in all directions from a un-uniform 'blob' roughly in the middle.
    Can you please tell me how I can achieve my aim?
    3) I had one more query when tracing my map ...  I have two shapes and the paths align along one edge, think of the south border of Scotland, and the north border of England for example.  At the moment I have these two paths running alongside each other but not joined. So if I didn't draw my pen accurately, there are small pockets where they don't touch. Ideally I would like to borrow the other path line for a time then leave it as it continues on it's own route.
    Sorry if I mixed up the terms, I hope you can understand me.
    Hope you can advise which tools I should be using, or some tutorials I can follow?
    Thanks in advance.

    Thanks Mylenium. I've certainly learnt something from both replies.  I have now finished tracing the countries using your paste and cut method.  It was quite a tedious job!  I also found using the lasso tool and direct selecion tool that I could highlight just the area that bordered the next county/country.  My the latter stages I had to select multiples, join them and then add, delete more anchor points.  I'm sure there must be an easier way to trace an image!
    I tried the live trace, but the map I was using was too detailed it traced geography and not the borders.  Anyway, I'm there now.  Thanks for the advice.
    I think I'm on the wrong track with the 'blob'. I didn't mean the blob tool on AI, but was referring to the middle content of my map following the railway line, which is the bit I wanted to 'stand out' from the rest. I have perservered and think I'm getting somewhere with the gradients.
    Thanks also Skullmaster for the idea of gradient.  It wasn't working how I need, but from your link I found how to make a 'transparent opacity mask' which I have used with a photo in the background to some effect.
    It is a feature rich software and hard to know what to look for when I'm not sure of the terms.  Unfortunately I have a deadline for what I'm doing and this map is only a small part of it.  It will have to remain a work in progress as I slowly learn more techniques.
    I'm sure I'll be back with more ...

  • How to make this in Adobe Photoshop CS5? PLEASE Help!

    Hey guys, i reallllllllly  want to know how to make this image in adobe photoshop.... the cone around the forecast track. Can you guys please show me how to do this? Id greatly appreciate it!

    There's a lot implied here, but you're not going to get around having to do the following in general:
    Use an unmarked map as a background.
    Draw shapes on layer(s) above the background and make them partially transparent.
    Obviously the key is to draw shapes that express the "cone of uncertainty" exactly as you want it to look, and with a minimum of fuss.
    I'd suggest drawing shapes with Path tools, then filling the shapes, applying a stroke (for the edge border), and using masking to hide parts you don't want to show (or which overlap with the other parts you're drawing).
    Are you needing to do this over and over or just once?
    -Noel

  • How to make a clip art (diagram )interactive report?

    Hello ABAPers,
                           I want help from you. I have a requirement like ..when i am excuteing a report i should get a clip art and the clipart which i got i have to double click on it there by i should get the details of that clip art. I have succeed till getting the clip art and from here i am not getting the idea how to make the clipart(diagram) active so tht when i am doubleing it i should get the details.
    The code that i am using to get the clip art just copy and execute you will get the output till clipart.
    *& Report  ZCLIPART_IR                                                 *
    REPORT  ZCLIPART_IR.
    START OF DO NOT CHANGE***********************************
    DATA: docking TYPE REF TO cl_gui_docking_container,
          picture_control_1 TYPE REF TO cl_gui_picture,
          url(256) TYPE c .
    DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
          html_table LIKE w3html OCCURS 1,
          return_code LIKE  w3param-ret_code,
          content_type LIKE  w3param-cont_type,
          content_length LIKE  w3param-cont_len,
          pic_data LIKE w3mime OCCURS 0,
          pic_size TYPE i.
    END OF DO NOT CHANGE***********************
    DATA : sum(4) , num1(4) , num2(4).
    PARAMETERS: p_dummy(4) DEFAULT '4' .
    PARAMETERS: p_dummy1(4) DEFAULT '5' .
    AT SELECTION-SCREEN OUTPUT.
      PERFORM show_pic.
      START-OF-SELECTION.
    *& Form show_pic
    FORM show_pic.
       DATA: repid LIKE sy-repid.
             repid = sy-repid.
      CREATE OBJECT picture_control_1 EXPORTING parent = docking.
      CHECK sy-subrc = 0.
      CALL METHOD picture_control_1->set_3d_border
        EXPORTING
          border = 5.
      CALL METHOD picture_control_1->set_display_mode
        EXPORTING
          display_mode = cl_gui_picture=>display_mode_stretch.
      CALL METHOD picture_control_1->set_position
        EXPORTING
          height = 50
          left   = 40
          top    = 30
          width  = 190.
    CHANGE POSITION AND SIZE ABOVE****************
    IF url IS INITIAL.
    REFRESH query_table.
        query_table-name  = '_OBJECT_ID'.
    CHANGE IMAGE NAME BELOW UPLOADED IN SWO0*****************
        query_table-value = 'ENJOYSAP_LOGO'.
        APPEND query_table.
        CALL FUNCTION 'WWW_GET_MIME_OBJECT'
          TABLES
            query_string        = query_table
            html                = html_table
            mime                = pic_data
          CHANGING
            return_code         = return_code
            content_type        = content_type
            content_length      = content_length
          EXCEPTIONS
            object_not_found    = 1
            parameter_not_found = 2
            OTHERS              = 3.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
        CALL FUNCTION 'DP_CREATE_URL'
          EXPORTING
            type     = 'image'
            subtype  = cndp_sap_tab_unknown
            size     = pic_size
            lifetime = cndp_lifetime_transaction
          TABLES
            data     = pic_data
          CHANGING
            url      = url
          EXCEPTIONS
            OTHERS   = 1.
            ENDIF.
            CALL METHOD picture_control_1->load_picture_from_url
        EXPORTING
          url = url.
    ENDFORM.
    Thks and waiting for your replies.

    Hi ataran,
    in case, your version of iMovie is able to import the footage, have a read here:
    http://www.apple.com/ilife/tutorials/imovie/

  • How to Make Hair Appear in Front of and Behind an MC Object?

    Hello again,
      I am making a character with lots of hair. I would like to know how to make the hair appear both in front of and behind the Movie Clip object.
      I'll explain further. I have the "frontHair" connected to the "head" MC. When I pivot the head, a bare spot shows in an outlined shape of the arms/legs/torso. I thought I'd remedy this by making "hairBack" and then layer it behind the object. This opens up a can of troubles.
      I can't seem to get the "hairBack" to appear behind the torso and arms. Also, the "frontHair" is now blocking me from grabbing onto the arms and legs.
      It's crucial that this character has all of the hair, but I can't seem to figure out how to make it happen.
      Please, help!
    Thank you,
       Mike
    p.s. While returning from a beer run, I thought about masking. I'm still trying to work out the logic on this one.

    Thank you for replying. II didn't know which specific layers and objects you were referring to, but I figured out the problem I was having.
      I used only one newly created "hair" object and set it to "Guide" to get it out of the way (in a sense). I then selected all the body parts (movie clips) that I could and selected "Move to Front" for each one. I used the Selection Tool to move the head (with connected hair) out of the way. After doing this I was able to select the "torso"; which was previously hidden behind the Armature Layer. I then put the head back in place and I was set to roll.
      Ah, but then I encountered another error. My animations are set to 24fps, but they are moving at least 10 times slower. This happens within Flash and in the exported swf files.
    The topic deals with "text field variable names" errors and compiler errors dealing with "Symbol 'fps' ".
    This is the address to that topic. http://forums.adobe.com/thread/1009225
    Thank you (again),
      Mike

  • How to make this effect in Keylight?

    Hi, I have question, how to make this effect in Keylight?
    I know that this overlay is added here:
    http://oi57.tinypic.com/1174fup.jpg
    Photos:
    http://iv.pl/images/18475588964010299091.jpg

    Keylight what? All I see is some effect similar to Leave Color, a.k.a the Pleasantville effect that made the rounds 10 years ago. It may require additional masking and otehr effects, but definitely not something that is specifically related to Keylight...
    Mylenium

  • How to make the inputs appear in Playback

    Hi,
    I would like to know how to make the inputs (line-in, mic, SPDIF-in) appear in playback of windows's mixer ?
    Im running XP pro sp3 with XFI Extreme Audio PCI-Express.
    I dont know why but there is no inputs in playback that making me unable to hear it while its being recorded.
    <img border="0" height="405" width="640" src="http://img70.imageshack.us/img70/672/mixergq0.png">
    <img border="0" height="542" width="640" src="http://img399.imageshack.us/img399/486/allmysettingsmq2.png">
    Message Edited by Nuja on 0-06-2009 2:07 [email protected]

    - I've read a little more and come to these conclusions:
    . The instructions presume that a CD is included with the card for the purpose of installing the software. A CD/DVD reader is a requirement for this reason.
    2. The card uses Intel HD Audio. This changes enough of what I know about CL's card that I really don't know that the lack of external inputs in the playback mixer is not intentional and uni'versal. A recording application could let you listen to what is being recorded by having an option of playing back what's being recorded.
    I have enough uncertainty now that I don't think it's useful for me to continue commenting. If someone who has a? PCI Express X-Fi Xtreme Audio that came with the software CD and hard-copy documentation wishes to share whether or not they have line-in, etc. in the playback mixer, it could be useful.
    -Dave
    ?[email protected]

  • How to make the video looks greenish ?

    Hi there,
    Can I know how to make a video looks bit greenish ?
    Thanks

    Thanks Karsten,
    Can I know, if I have about 60 cuts on the timeline and I want all the 60 cuts to be greenish, how do I apply to all at one go (instead of having to do one by one for 60 times !) ?
    Thanks again
    Karsten Schlüter wrote:
    first 3 options coming to mind
    a) ready made: under Effects 'Nightvision' (switch-off the mask)
    b) almost ready made: under Effects, 'Colorize', set color to green
    b) Color Board, Color, push general to green

  • How to make treetable transparent

    hi,
    Does anyone have idea how to make the treetable transparent so that the background image can be shown?
    Pls provide sample code if possible,thanks!

    I don't know if I can come up with some code example
    for you since I don't know what treetable your are
    using... but... Transparency is always going to relate
    to the whether your components are opaque or not.
    Opaque = Not Transparent, so setting opaque = false
    will hopefully make your table transparent. You may
    need to do this on your CellRenderer's as well.
    Hope this helps,
    Josh Castagno
    http://www.jdc-software.com
    hi,
    i am using JTreeTable provided fron Sun swing connection article,by Scott Violet and Kathy Walrath.
    The situation i am facng now is jtree able to be transparent, but jtable still using it default background.
    Below are excerpt from sample, setOpaque(false) to jtable seem doesn't take effect.
    As i an newbie to swing,kindly point out where part shd i modified on the code. Thz!
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    import javax.swing.tree.*;
    import javax.swing.table.*;
    import java.awt.event.*;
    import java.util.EventObject;
    * This example shows how to create a simple JTreeTable component,
    * by using a JTree as a renderer (and editor) for the cells in a
    * particular column in the JTable.
    * @version 1.2 10/27/98
    * @author Philip Milne
    * @author Scott Violet
    public class JTreeTable extends JTable {
    /** A subclass of JTree. */
    protected TreeTableCellRenderer tree;
    public JTreeTable(TreeTableModel treeTableModel) {
         super();
         // Creates the tree. It will be used as a renderer and editor.
         tree = new TreeTableCellRenderer(treeTableModel);
         // Installs a tableModel representing the visible rows in the tree.
         super.setModel(new TreeTableModelAdapter(treeTableModel, tree));
         // Forces the JTable and JTree to share their row selection models.
         ListToTreeSelectionModelWrapper selectionWrapper = new
         ListToTreeSelectionModelWrapper();
         tree.setSelectionModel(selectionWrapper);
         setSelectionModel(selectionWrapper.getListSelectionModel());
         // Installs the tree editor renderer and editor.
         setDefaultRenderer(TreeTableModel.class, tree);
         setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
         // No grid.
         setShowGrid(false);
    //added
    setOpaque(false);
         // No intercell spacing
         setIntercellSpacing(new Dimension(0, 0));     
         // And update the height of the trees row to match that of
         // the table.
         if (tree.getRowHeight() < 1) {
         // Metal looks better like this.
         setRowHeight(20);
    * Overridden to message super and forward the method to the tree.
    * Since the tree is not actually in the component hierarchy it will
    * never receive this unless we forward it in this manner.
    public void updateUI() {
         super.updateUI();
         if(tree != null) {
         tree.updateUI();
         // Do this so that the editor is referencing the current renderer
         // from the tree. The renderer can potentially change each time
         // laf changes.
         setDefaultEditor(TreeTableModel.class, new TreeTableCellEditor());
         // Use the tree's default foreground and background colors in the
         // table.
    LookAndFeel.installColorsAndFont(this, "Tree.background",
    "Tree.foreground", "Tree.font");
    * Workaround for BasicTableUI anomaly. Make sure the UI never tries to
    * resize the editor. The UI currently uses different techniques to
    * paint the renderers and editors; overriding setBounds() below
    * is not the right thing to do for an editor. Returning -1 for the
    * editing row in this case, ensures the editor is never painted.
    public int getEditingRow() {
    return (getColumnClass(editingColumn) == TreeTableModel.class) ? -1 :
         editingRow;
    * Returns the actual row that is editing as <code>getEditingRow</code>
    * will always return -1.
    private int realEditingRow() {
         return editingRow;
    * This is overridden to invoke super's implementation, and then,
    * if the receiver is editing a Tree column, the editor's bounds is
    * reset. The reason we have to do this is because JTable doesn't
    * think the table is being edited, as <code>getEditingRow</code> returns
    * -1, and therefore doesn't automatically resize the editor for us.
    public void sizeColumnsToFit(int resizingColumn) {
         super.sizeColumnsToFit(resizingColumn);
         if (getEditingColumn() != -1 && getColumnClass(editingColumn) ==
         TreeTableModel.class) {
         Rectangle cellRect = getCellRect(realEditingRow(),
                             getEditingColumn(), false);
    Component component = getEditorComponent();
         component.setBounds(cellRect);
    component.validate();
    * Overridden to pass the new rowHeight to the tree.
    public void setRowHeight(int rowHeight) {
    super.setRowHeight(rowHeight);
         if (tree != null && tree.getRowHeight() != rowHeight) {
    tree.setRowHeight(getRowHeight());
    * Returns the tree that is being shared between the model.
    public JTree getTree() {
         return tree;
    * Overridden to invoke repaint for the particular location if
    * the column contains the tree. This is done as the tree editor does
    * not fill the bounds of the cell, we need the renderer to paint
    * the tree in the background, and then draw the editor over it.
    public boolean editCellAt(int row, int column, EventObject e){
         boolean retValue = super.editCellAt(row, column, e);
         if (retValue && getColumnClass(column) == TreeTableModel.class) {
         repaint(getCellRect(row, column, false));
         return retValue;
    * A TreeCellRenderer that displays a JTree.
    public class TreeTableCellRenderer extends JTree implements
         TableCellRenderer {
         /** Last table/tree row asked to renderer. */
         protected int visibleRow;
         /** Border to draw around the tree, if this is non-null, it will
         * be painted. */
         protected Border highlightBorder;
         public TreeTableCellRenderer(TreeModel model) {
         super(model);
         * updateUI is overridden to set the colors of the Tree's renderer
         * to match that of the table.
         public void updateUI() {
         super.updateUI();
         // Make the tree's cell renderer use the table's cell selection
         // colors.
         TreeCellRenderer tcr = getCellRenderer();
         if (tcr instanceof DefaultTreeCellRenderer) {
              DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer)tcr);
              // For 1.1 uncomment this, 1.2 has a bug that will cause an
              // exception to be thrown if the border selection color is
              // null.
              // dtcr.setBorderSelectionColor(null);
              dtcr.setTextSelectionColor(UIManager.getColor
                             ("Table.selectionForeground"));
              dtcr.setBackgroundSelectionColor(UIManager.getColor
                                  ("Table.selectionBackground"));
         * Sets the row height of the tree, and forwards the row height to
         * the table.
         public void setRowHeight(int rowHeight) {
         if (rowHeight > 0) {
              super.setRowHeight(rowHeight);
              if (JTreeTable.this != null &&
              JTreeTable.this.getRowHeight() != rowHeight) {
              JTreeTable.this.setRowHeight(getRowHeight());
         * This is overridden to set the height to match that of the JTable.
         public void setBounds(int x, int y, int w, int h) {
         super.setBounds(x, 0, w, JTreeTable.this.getHeight());
         * Sublcassed to translate the graphics such that the last visible
         * row will be drawn at 0,0.
         public void paint(Graphics g) {
         g.translate(0, -visibleRow * getRowHeight());
         super.paint(g);
         // Draw the Table border if we have focus.
         if (highlightBorder != null) {
              highlightBorder.paintBorder(this, g, 0, visibleRow *
                             getRowHeight(), getWidth(),
                             getRowHeight());
         * TreeCellRenderer method. Overridden to update the visible row.
         public Component getTableCellRendererComponent(JTable table,
                                  Object value,
                                  boolean isSelected,
                                  boolean hasFocus,
                                  int row, int column) {
         Color background;
         Color foreground;
         if(isSelected) {
              background = table.getSelectionBackground();
              foreground = table.getSelectionForeground();
         else {
              background = table.getBackground();
              foreground = table.getForeground();
         highlightBorder = null;
         if (realEditingRow() == row && getEditingColumn() == column) {
              background = UIManager.getColor("Table.focusCellBackground");
              foreground = UIManager.getColor("Table.focusCellForeground");
         else if (hasFocus) {
              highlightBorder = UIManager.getBorder
              ("Table.focusCellHighlightBorder");
              if (isCellEditable(row, column)) {
              background = UIManager.getColor
                   ("Table.focusCellBackground");
              foreground = UIManager.getColor
                   ("Table.focusCellForeground");
         visibleRow = row;
         setBackground(background);
         TreeCellRenderer tcr = getCellRenderer();
         if (tcr instanceof DefaultTreeCellRenderer) {
              DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer)tcr);
              if (isSelected) {
              dtcr.setTextSelectionColor(foreground);
              dtcr.setBackgroundSelectionColor(background);
              else {
              dtcr.setTextNonSelectionColor(foreground);
              dtcr.setBackgroundNonSelectionColor(background);
         return this;
    * An editor that can be used to edit the tree column. This extends
    * DefaultCellEditor and uses a JTextField (actually, TreeTableTextField)
    * to perform the actual editing.
    * <p>To support editing of the tree column we can not make the tree
    * editable. The reason this doesn't work is that you can not use
    * the same component for editing and renderering. The table may have
    * the need to paint cells, while a cell is being edited. If the same
    * component were used for the rendering and editing the component would
    * be moved around, and the contents would change. When editing, this
    * is undesirable, the contents of the text field must stay the same,
    * including the caret blinking, and selections persisting. For this
    * reason the editing is done via a TableCellEditor.
    * <p>Another interesting thing to be aware of is how tree positions
    * its render and editor. The render/editor is responsible for drawing the
    * icon indicating the type of node (leaf, branch...). The tree is
    * responsible for drawing any other indicators, perhaps an additional
    * +/- sign, or lines connecting the various nodes. So, the renderer
    * is positioned based on depth. On the other hand, table always makes
    * its editor fill the contents of the cell. To get the allusion
    * that the table cell editor is part of the tree, we don't want the
    * table cell editor to fill the cell bounds. We want it to be placed
    * in the same manner as tree places it editor, and have table message
    * the tree to paint any decorations the tree wants. Then, we would
    * only have to worry about the editing part. The approach taken
    * here is to determine where tree would place the editor, and to override
    * the <code>reshape</code> method in the JTextField component to
    * nudge the textfield to the location tree would place it. Since
    * JTreeTable will paint the tree behind the editor everything should
    * just work. So, that is what we are doing here. Determining of
    * the icon position will only work if the TreeCellRenderer is
    * an instance of DefaultTreeCellRenderer. If you need custom
    * TreeCellRenderers, that don't descend from DefaultTreeCellRenderer,
    * and you want to support editing in JTreeTable, you will have
    * to do something similiar.
    public class TreeTableCellEditor extends DefaultCellEditor {
         public TreeTableCellEditor() {
         super(new TreeTableTextField());
         * Overridden to determine an offset that tree would place the
         * editor at. The offset is determined from the
         * <code>getRowBounds</code> JTree method, and additionally
         * from the icon DefaultTreeCellRenderer will use.
         * <p>The offset is then set on the TreeTableTextField component
         * created in the constructor, and returned.
         public Component getTableCellEditorComponent(JTable table,
                                  Object value,
                                  boolean isSelected,
                                  int r, int c) {
         Component component = super.getTableCellEditorComponent
              (table, value, isSelected, r, c);
         JTree t = getTree();
         boolean rv = t.isRootVisible();
         int offsetRow = rv ? r : r - 1;
         Rectangle bounds = t.getRowBounds(offsetRow);
         int offset = bounds.x;
         TreeCellRenderer tcr = t.getCellRenderer();
         if (tcr instanceof DefaultTreeCellRenderer) {
              Object node = t.getPathForRow(offsetRow).
              getLastPathComponent();
              Icon icon;
              if (t.getModel().isLeaf(node))
              icon = ((DefaultTreeCellRenderer)tcr).getLeafIcon();
              else if (tree.isExpanded(offsetRow))
              icon = ((DefaultTreeCellRenderer)tcr).getOpenIcon();
              else
              icon = ((DefaultTreeCellRenderer)tcr).getClosedIcon();
              if (icon != null) {
              offset += ((DefaultTreeCellRenderer)tcr).getIconTextGap() +
                   icon.getIconWidth();
         ((TreeTableTextField)getComponent()).offset = offset;
         return component;
         * This is overridden to forward the event to the tree. This will
         * return true if the click count >= 3, or the event is null.
         public boolean isCellEditable(EventObject e) {
         if (e instanceof MouseEvent) {
              MouseEvent me = (MouseEvent)e;
              // If the modifiers are not 0 (or the left mouse button),
    // tree may try and toggle the selection, and table
    // will then try and toggle, resulting in the
    // selection remaining the same. To avoid this, we
    // only dispatch when the modifiers are 0 (or the left mouse
    // button).
              if (me.getModifiers() == 0 ||
    me.getModifiers() == InputEvent.BUTTON1_MASK) {
              for (int counter = getColumnCount() - 1; counter >= 0;
                   counter--) {
                   if (getColumnClass(counter) == TreeTableModel.class) {
                   MouseEvent newME = new MouseEvent
                   (JTreeTable.this.tree, me.getID(),
                        me.getWhen(), me.getModifiers(),
                        me.getX() - getCellRect(0, counter, true).x,
                        me.getY(), me.getClickCount(),
    me.isPopupTrigger());
                   JTreeTable.this.tree.dispatchEvent(newME);
                   break;
              if (me.getClickCount() >= 3) {
              return true;
              return false;
         if (e == null) {
              return true;
         return false;
    * Component used by TreeTableCellEditor. The only thing this does
    * is to override the <code>reshape</code> method, and to ALWAYS
    * make the x location be <code>offset</code>.
    static class TreeTableTextField extends JTextField {
         public int offset;
         public void reshape(int x, int y, int w, int h) {
         int newX = Math.max(x, offset);
         super.reshape(newX, y, w - (newX - x), h);
    * ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel
    * to listen for changes in the ListSelectionModel it maintains. Once
    * a change in the ListSelectionModel happens, the paths are updated
    * in the DefaultTreeSelectionModel.
    class ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel {
         /** Set to true when we are updating the ListSelectionModel. */
         protected boolean updatingListSelectionModel;
         public ListToTreeSelectionModelWrapper() {
         super();
         getListSelectionModel().addListSelectionListener
         (createListSelectionListener());
         * Returns the list selection model. ListToTreeSelectionModelWrapper
         * listens for changes to this model and updates the selected paths
         * accordingly.
         ListSelectionModel getListSelectionModel() {
         return listSelectionModel;
         * This is overridden to set <code>updatingListSelectionModel</code>
         * and message super. This is the only place DefaultTreeSelectionModel
         * alters the ListSelectionModel.
         public void resetRowSelection() {
         if(!updatingListSelectionModel) {
              updatingListSelectionModel = true;
              try {
              super.resetRowSelection();
              finally {
              updatingListSelectionModel = false;
         // Notice how we don't message super if
         // updatingListSelectionModel is true. If
         // updatingListSelectionModel is true, it implies the
         // ListSelectionModel has already been updated and the
         // paths are the only thing that needs to be updated.
         * Creates and returns an instance of ListSelectionHandler.
         protected ListSelectionListener createListSelectionListener() {
         return new ListSelectionHandler();
         * If <code>updatingListSelectionModel</code> is false, this will
         * reset the selected paths from the selected rows in the list
         * selection model.
         protected void updateSelectedPathsFromSelectedRows() {
         if(!updatingListSelectionModel) {
              updatingListSelectionModel = true;
              try {
              // This is way expensive, ListSelectionModel needs an
              // enumerator for iterating.
              int min = listSelectionModel.getMinSelectionIndex();
              int max = listSelectionModel.getMaxSelectionIndex();
              clearSelection();
              if(min != -1 && max != -1) {
                   for(int counter = min; counter <= max; counter++) {
                   if(listSelectionModel.isSelectedIndex(counter)) {
                        TreePath selPath = tree.getPathForRow
                        (counter);
                        if(selPath != null) {
                        addSelectionPath(selPath);
              finally {
              updatingListSelectionModel = false;
         * Class responsible for calling updateSelectedPathsFromSelectedRows
         * when the selection of the list changse.
         class ListSelectionHandler implements ListSelectionListener {
         public void valueChanged(ListSelectionEvent e) {
              updateSelectedPathsFromSelectedRows();

  • How to make a pressure sensitive brush in CS3?

    Hi!
    Is there someone out there who knows how to make a brush similar to this? I've been trying to figure it out for several hours now, but nothing works!
    Daniel

    Sorry but you aren't going to get something that looks like that from a pressure sensitive brush in Illustrator.
    The colors and groupings of blocks are too random to be a repeating pattern (a simple one, anyway) and the order is too consistent to be something like a scatter brush. That said, you *can* do this with a brush but it won't be pressure sensitive and it will require a degree of setup.
    Start by building a row of blocks. Mine is a simple pattern with a few pieces removed and not terribly interesting looking but hopefully it'll give you the idea of what I mean:
    Group everything and then go up to Effect> 3D> Rotate
    Set your X, Y, And Perspective parameters to taste. Keep the Z axes (the blue one) at zero:
    Go to Object> Expand Appearance You'll notice that Illustrator has put a clipping mask around your squares (transparent rectangle) Delete it.
    Take everything you have and drag it over to the brush panel and make a new Art Brush:
    Now you can select that brush and paint with it though you'll get better results by stroking a path you've drawn with the pen tool:
    A couple of things to keep in mind:
    You'll need to consider your ultimate length when creating the brush. Longer or more wavy lines will require more squares. My squares look a little skewed because I didn't bother to make my pattern very long. A longer row will improve the look of this but hopefully my example is enough to give you the idea.
    For generating the square colors, you might want to try the random fills script available from James talmage's page and then use live color to tint everything for you.

Maybe you are looking for

  • Time Capsule and a bunch of switches

    Hi all, I have been a PC for many years. Last fall, with the inheritance of an old iBook G4, I saw the light! Earlier this month I bought a new Macbook Pro and a 1 TB Time Capsule. I set about to dismantle my convoluted home network and replace it wi

  • Help! All my apps no longer connect to the internet

    When I am logged into my user account on my macbook pro, all of my apps can no longer access the internet, safari, mail, skype etc etc I thought it was just Safari, so I deleted plist file, but it is all my apps that are not connecting. Safari gives

  • APEX tabs do not appear in some browsers (after 5)

    I am using APEX 4.2 to build a fairly simple application. I am pretty new to this, but I noticed the following: I use standard level1 tabs and I noticed that depending on the browser I use I can only see a maximum of 5 tabs. It just does not display

  • Changes in sales order

    Hello, Table VBUK is for order header status. I made changes to sales order. which field in table indicates sales order change Date & Time? thanks

  • How to unlock all MBAM encrypted drives from the startup

    Hi, One of my client is using MBAM 2.5 in his environment and all the clients are running on Windows 7 ENT SP1. Once the user logging to his encrypted PC it will only unlock the operating system drive. User has to go to my computer and he has to unlo