Layout that allows overlaping components

I posted this in the general forum, I didn't know there was a swing forum:
I want to implement some kind of swing component, as of right now I'm using a JPane; and painting an image on it, to create tiles of a game board.
The problem is the tiles aren't square and I don't know how to allow the JPanels or JButtons or whatever component is easiest, to overlap in the places i need them to.
Here is an image of the type of tiles I want to use.
http://home.insightbb.com/~twilightimp/current_map.jpg
Does anyone have any ideas?
Do you think using a JLayeredPane to house all my tiles in would work, with the z-component increasing every row from the middle row?
thanks
Message was edited by:
z0isch

I got it working with JButtons and a JLayeredPane.
=D

Similar Messages

  • Using a layout to allow overlapping components

    I want to implement some kind of swing component, as of right now I'm using a JLabel and painting an image on it, to create tiles of a game board.
    The problem is the tiles aren't square and I don't know how to allow the JLabels or JButtons or whatever component is easiest, to overlap in the places i need them to.
    Here is an image of the type of tiles I want to use.
    http://home.insightbb.com/~twilightimp/current_map.jpg
    Does anyone have any ideas?
    thanks

    Swing questions should be posted in the Swing forum. Here's an article that shows you how to create round buttons in Swing, maybe it will help.
    http://java.sun.com/developer/TechTips/txtarchive/1999/Aug99_PatrickC.txt

  • Screens that allow Embedded Components

    Hi All,
    I have a screen (ProjectGAFEnhancedController_GAF) that I am required to extend via an embedded component. It has an OutportAnchor which gives me the option to add an embedded component but when I try to do so, i get the message: The selected outport does not reference a PaneContainerAnchor. Is it possible to extend this screen? Also, is there a published list of screens that allow extensibility via Embedded Components? It is rather frustrating to have to open up each screen one-by-one to see whether or not it allows an Embedded Component. Especially given the speed of the ui designer.
    Thanks,
    Mark

    Flash is dead.  Nobody uses Flash video anymore; not even YouTube because mobile and tablet devices can't support it.  The trend now is to use HTML5 video which is supported by all modern web devices.  In addition, HTML5 video has default player and control bar which supports full screen mode (icon with 4 arrows).  So no 3rd party player is required.
    To give you an example, copy & paste this code into a new, blank document.  SaveAs video_test.html and preview in browsers.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 with Video</title>
    <!--help for older IE browsers-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>
    <style>
    video {
        max-width:100%;
        display:block;
        margin:0 auto;
    </style>
    <body>
    <h2>Use 3 File Types to support all browsers &amp; mobile devices:  MP4, WEBM and OGV.</h2>
    <h3>Online Video Converter ~ http://video.online-convert.com/</h3>
    <!--begin video-->
    <video controls poster="Your_poster_image.jpg">
    <!--these are 6 sec sample videos for testing purposes. Replace sample-videos with your own files-->
    <source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm">
    <source src="http://techslides.com/demos/sample-videos/small.ogv" type="video/ogg">
    <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
    If you're seeing this, you're using an
    outdated browser that doesn't support
    the video tag.
    </video>
    <!--end video-->
    </body>
    </html>
    That's all there is to it.
    ♥ Happy Valentine's Day 
    Nancy O.

  • Dispatching Events on overlapping Components

    Hello,
    i use a layered pane that contains some custom components. How can I make that two overlapping components that reside in the same layer both receive a mouseEvent?
    At the moment, only the Componet above receives the event - I know I can pass an Event with dispatchEvent - but i don't know the instance of the component to which to pass it of course... Is there any method to dispatch the event without having to know to which component to pass it?
    Any help appreciated.
    Best regards & Thanks.
    alex

    You can use use EventQueue.postEvent to post the event, but it requires source and if it is mouse event it will be later retargeted to correct components according to coordinates. So the only way for you to do this is to find the components by yourself and call processMouseEvent on it.

  • [svn] 4634: First part of glue code for allowing Halo components to use the new Text Layout Framework , in order to get functionality such as bidirectional text.

    Revision: 4634
    Author:   [email protected]
    Date:     2009-01-22 17:38:56 -0800 (Thu, 22 Jan 2009)
    Log Message:
    First part of glue code for allowing Halo components to use the new Text Layout Framework, in order to get functionality such as bidirectional text.
    Background:
    TLF is making this possible by implementing a TLFTextField class. It is a Sprite that uses TLF to implement the same properties and methods as the legacy TextField class in the Player. Thanks to the createInFontContext() bottleneck method in UIComponent, it can be used by a properly-written Halo component (such as those in Flex 3) without any modifications to the component.
    Note: Text should render similarly -- but is unlikely to render identically -- when a component uses TLFTextField vs. TextField. The width and height may be different, affecting layout; text could wrap differently; etc. This is a fact-of-life based on the fact that TLF/FTE and TextField are completely different text engines.
    Whether a Halo component uses TLF or not to render text will be determined in Flex 4 by a new style, textFieldClass. (Gumbo components always use TLF.)
    TLFTextField is currently only partially implemented. It does not yet support scrolling, selection, editing, multiple formats, or htmlText. Therefore it can only be used for simple display text, such as a Button label.
    Details:
    The TextStyles.as bucket 'o text styles now includes a non-inheriting textFieldClass style. It can be set to either mx.core.UITextField or mx.core.UITLFTextField. These are the Flex framework's wrapper classes around the lower-level classes flash.text.TextField (in the Player) and its TLF-based workalike, flashx.textLayout.controls.TLFTextField.
    The global selector in defaults.css currently sets it to mx.core.UITextField using a ClassReference directive. For the time being, all Halo components will continue to use the "real" TextField.
    The new UITLFTextField is a copy of UITextField, except that it extends TLFTextField instead of TextField. This class has been added to FrameworkClasses.as because no classes in framework.swc have a dependency on it. It will get soft-linked into applcations via the textFieldClass style.
    The TLFTextField class currently lives in a fourth TLF SWC, textLayout_textField.swc. This SWC has been added to various build scripts. The external-library-path for building framework.swc now includes all four TLF SWCs, because UITLFTextField can't be compiled and linked without them. However, since they are external they aren't linked into framework.swc.
    Properly-written Halo UIComponents access their text fields only through the IUITextField interface, and they create text fields like this:
    textField = IUITextField(createInFontContext(UITextField));
    (The reason for using createInFontContext() is to support embedded fonts that are embedded in a different SWF.)
    The createInFontContext() method of UIComponent has been modified to use the textFieldClass style to determine whether to create a UITextField or a UITLFTextField.
    With these changes, you can now write code like
    to get two Buttons, the first of which uses UITextField (because this is the value of textFieldClass in the global selector) and the second of which uses UITLFTextField. They look very similar, which is good!
    Currently, both Buttons are being measured by using an offscreen TextField. A subsequent checkin will make components rendering using UITLFTextField measure themselves using an offscreen TLFTextField so that measurement and rendering are consistent.
    QE Notes: None
    Doc Notes: None
    Bugs: None
    Reviewer: Deepa
    Modified Paths:
        flex/sdk/trunk/asdoc/build.xml
        flex/sdk/trunk/build.xml
        flex/sdk/trunk/frameworks/projects/framework/build.xml
        flex/sdk/trunk/frameworks/projects/framework/defaults.css
        flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/TextStyles.as
    Added Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITLFTextField.as

    Many of your points are totally legitimate.
    This one, however, is not:
    …To put it another way, the design of the site seems to be geared much more towards its regular users than those the site is supposedly trying to "help"…
    The design and management of the forums for more than five years have driven literally dozens of the most valuable contributors and "regulars" away from the forums—permanently.
    The only conclusion a prudent, reasonable person can draw from this state of affairs is that Adobe consciously and deliberately want to kill these forums by attrition—without a the PR hit they would otherwise take if they suddenly just shut them down.

  • Which is the easy layout in swing that allows component setSize() ?

    Hi,
    I am new to swing, Can any body suggest me which one is the easiest layout to implement that allows setting height and width of components.
    I have found that with layouts, setting component height and width do not work.
    Thank you.

    Using a LayoutManager and manually setting the size of components is to a large degree mutually exclusive.
    It is the LayoutManager that determines the location and the size of the child components.
    So, when using LayoutManagers, one only sets the size of the top level container. Its LayoutManager will do the rest, based on supplied constraints and the values that child components return on getPreferredSize, getMaximumSize and getMinimumSize.
    You may influence these values by setting them explicitly on the child components.
    Piet
    Edited by: pietblok on 13-feb-2009 13:12

  • The toolbar in the adobe app that allows you to choose the brightness level and the page layout doesn't hide. Because of that, i of course am unable to read the top part of the page...[Android]

    The toolbar in the adobe app that allows you to choose the brightness level and the page layout doesn't hide. Because of that, i of course am unable to read the top part of the page. I cannot find anything in the settings that will make it go away. What do i do? I use Samsung Ace.

    What is the Acrobat DC version and the android version that you are running? You can find the Acrobat version here: How to find the Acrobat DC version installed on your Android device

  • I need a spreadsheet that  allow any advanced functionality such as macros and active x components. Any possibility of that ever happenning?

    I have spreadsheets that contain macros. Unless and until software producers change the programming or capability that allow any advanced functionality such as macros and active x components, I cannot use my ipad. So I am forced to lug my laptop and my ipad around when the ipad would be perfect for my work in insurance. The fact that this capability does not exsist in docs to go or numbers means there either is a major hang up or these software manufacturers don't feel the need is strong enough. Either way, it really puts people like me in a bind. Does anyone have a solution for this? Is it really that hard of a thing to do to be able to read and run macros?

    Unfortunately there is NONE. I have tried searching for a long time but never succeeded to find an app that can read Macros. I hope there must be a very strong limitation for developers to support macros.

  • Overlapping components problem

    Hello,
    I have been developing an applet for Quickplaces. Basically it shows what is happening in the Quickplace from different kind of views. A view from a document where people can see who has been viewing it for example. Or a view from a member where one can see what documents the member wrote.
    Now I have chosen to implement a sort of circle visualisation for this. In the center is the object the view is about, a document, a member, etc. Outwards are other objects. In the case of a document view, the members that responded to it, in a circle more outward: members that viewed it. Etc. It's sort of a dartboard.
    I have written a custom layoutmanager for each view for this. A problem I have encountered is that once I tell a member or document component to let itself be placed by the layout managerr I get a fixed size component. It looks ok until you for example hover over it, wich I have keyed to a zooming in on details method. When you do that your usually overlapping other components. Why, components can be overlapped without zooming in some views. The problem is the mouselistener I have attached fires when I hover over de component size. Not the size of the actual graphical representation. My members for example are represented by a sphere. They are bounded by a rectangle component though. So if I enter my mouse anywhere near the sphere... it already zooms in, resulting in the user zooming in on a member, but actually he wanted to zoom in on a member that was close to this one, but for the code was "underneath" the component of the other member.
    It's a bit hard to explain without posting a screenshot.
    How do I fix this?

    Hi,
    I need a clarification, taking the example you
    provided:
    you have a rectangle components, that display spheres.I have a viewer class for document's member's and room's. RoomViewer, MemberViewer, etc. These paint the actual graphic. They are given a size by the custom layoutmanager i wrote like this:
            //Layout members
            int mems = members.size();
            if(mems != 0){
                double angle = 360 / mems;
                double baseAngle = 0;
                synchronized(members){
                     Iterator iter = members.iterator();
                     while(iter.hasNext()){
                         MemberViewer tempMember = (MemberViewer)iter.next();
                         Dimension d = tempMember.getSize();
                         double lastLog = tempMember.getMember().getLastLog() * 160 + Math.sqrt((Math.pow(50, (double)2) + Math.pow(50, (double)2)));
                         int xCoord = (int)((xCenter + (Math.cos(Math.toRadians(baseAngle)) * lastLog)) - (0.5 * d.getWidth()));
                         int yCoord = (int)((yCenter + (Math.sin(Math.toRadians(baseAngle)) * lastLog)) - (0.5 * d.getHeight()));
                         tempMember.setBounds(xCoord, yCoord, container_size, container_size);
                         baseAngle += angle;
            }A viewer get's it's data from the model class. MemberViewer from Member, etc.
    First you want to zoom only when the mouse is hovered
    on the sphere. Is that right ?Yes I have implemented the enters part of the mouselistener. As soon as the mouse enters the component in wich the graphical representation is drawn it zooms. with zoom I multiply the size by some and add some different graphs inside the circle, but that is not important. What is interesting is probably that the size of the component when it is not zoomed is the size for when it is zoomed in, or the zoom in would be cut off by the component boundaries.
    What about the overlapping ? could you clarify a bit
    please.
    Basically it overlaps nicely on the view. Once you interact though I get stuck. Clicking, entering and exiting is supposed to do things. But all these 3 fire when your mouse does that thing inside the component, not inside the graphical representation. So you start zooming quite a bit away from the circle of a member btw, because that distance is already part of the component, but not of the drawing.
    Who is reponsible for drawing the shapes ?The Viewers paint themselves. The Layoutmanager gives them a basic place to start their own painting and a View class controls the layoutmanager.
    And who listens to mouse motion ?The viewers themselves do. They implement mouseListener.
    in mouseMoved(MouseEvent e)
    you can get the point with e.getPoint(); where the
    mouse points to.
    This will help you to handle the event only when
    hovered on the shape,
    but it will maybe not solve the hovering over
    overlapped components.I don't quite follow that. A Shape can still not implement MouseListener.

  • Acrobat form field that allows Reader user to browse and insert a picture into a predefined area

    Is there a way to do insert a form field into an AcroForm that allow Reader users to browse and insert a picture into that form field?
    I know that LiveCycle can do this, but I need to do this using an AcroForm. Or maybe there's a third-party plug-in that can be used in an AcroForm to do this?

    Jay,
    The new version of Reader, which was announced today (see AcrobatUsers.com), will now allow you to use the field.buttonImportIcon method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.737.html
    For a bit more information, see: http://forums.adobe.com/thread/743823
    Here's the minimum code that can be used in the Mouse Up event of a button that's configured with a layout that's something other than "Label only":
    // Mouse Up script for a button
    event.target.buttonImportIcon();
    Since this isn't backwards compatible with Reader, you'll probably want to add additional code to test what version is being used and alert the user if it's pre-11. You should also check the return value to see if anything went wrong. The hard part is getting everyone to upgrade, but this and a number of other features should make it worth it.

  • Is there an app that allows for content to be arranged within an interface similar to the App Store's interface?

    I have tried a number of applications for arranging media. The ones I am looking to use at work however, we like to have using feeds from sites like flickr. We have Flipboard, which looks great, and usually works pretty great too, but there are errors and lame things about it. This app arranges images based on upload date, which you have to change manually through flickr to make images display in the correct format which is a pain, and images still will become out of alignment in landscape vs. portrait mode.
    I was wondering if there was a media app out there that is arranged similar to the app store? I think this would make for a really slick interface to have. Being able to have heading images and sections along with panning sections lower on the page that allow you to scroll content and click to access a larger view.
    Has anyone found really great media displaying apps? Any that happen to be similar to the app store layout? Really, any apps you have found for displaying content would be a great help.
    Thanks!

    Not that I know of, and having seen a picture of it
    http://www.ati-news.de/Bilder/Sapphire/AIW9700pro/TV/thruview.jpg
    Doesn't look all that great, you lose so much of the picture quality just to see a desktop?
    Better to have a 1/8 th page window floating on top of other windows instead.

  • In past versions of FireFox there was a view option that allowed a change in size of fonts and objects on the screen temporarily on the fly. This seems to be missing from version 6.

    In past versions of FireFox there was a view option that allowed a change in size of fonts and objects on the screen temporarily on the fly. This seems to be missing from version 6. It was very useful and needs to be added to version 6.

    You can use "Ctrl +" and "Ctrl -" to zoom pages quickly and "Ctr 0" (zero) to reset the page zoom.
    *http://kb.mozillazine.org/Zoom_text_of_web_pages
    There are also page zoom buttons in the toolbar palette in the Customize window that you can drag on a toolbar.
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    *http://kb.mozillazine.org/Toolbar_customization
    *https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • HT4168 Is there a version of Pages that allows you to paste a webpage?

    Is there a version of Pages that allows you to paste a webpage into Pages and retain the text that's on the webpage?  Pages-09 drops about 90% of the web-page text, when a webpage is pasted into Pages.

    1. You can print webpages to pdf in Safari and retain all the links
    2. Pages does retain most of the formatting your problem is probably the way you selected it and insufficient width in the page to fit the layout
    3. There are some objects and code that won't translate to DTP document, Pages is not a browser
    4. If all you want is the text use command option shift v
    Peter

  • HT1557 where do i find Universal Binary Component compatible with Intel-based Macintosh that allows quicktime to show video?

    where do i find the link to the Universal Binary Component compatible with Intel-based Macintosh that allows quicktime to show video?

    I think your question is too vague to get an answer.
    You're asking for a 'Universal Binary component' for your 'Intel-based Macintosh'. Why universal binary?
    universal binaries are designed to work on both PowerPC and Intel machines. If you're using an Intel machine why do you need PowerPC support?
    Also, you want something that 'allows QuickTime to show video'. Well, not to be glib, but QuickTIme does video - that's it's raison d'etre. Therefore I think your question is more about how to get QuickTime to show a specific (non-standard?) video format. Without knowing what that format is, it's impossible to answer your question directly.
    That said, maybe the place to start is Apple's QuickTime Components index.

  • [svn:osmf:] 9866: Adding '@throws' clauses to ILayoutRenderer add/ remove target methods, and adding a 'targets(target:ILayoutTarget)' method that allows checking addition/removal validity up front.

    Revision: 9866
    Author:   [email protected]
    Date:     2009-09-01 00:56:48 -0700 (Tue, 01 Sep 2009)
    Log Message:
    Adding '@throws' clauses to ILayoutRenderer add/remove target methods, and adding a 'targets(target:ILayoutTarget)' method that allows checking addition/removal validity up front.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/openvideoplayer/layout/ILayoutRenderer.as
        osmf/trunk/framework/MediaFramework/org/openvideoplayer/layout/LayoutRendererBase.as

Maybe you are looking for

  • How do I access an iTunes library from different computers?

    Hi I have my iTunes Media on a NAS but the library files on my local disk (WIndows 7). Is there any way I can allow my wife to access the same Media folder on the NAS from her laptop (also Windows 7 and on the same network)? Using iTunes server will

  • Disk Utility Error 254 **SOLVED**

    This persistent problem has been a bugaboo for years and has been the cause of many long nights and huge frustration for me. You follow the standard instructions for putting an .iso on a USB using Restore in Disk Utility and it doesn't do it, returns

  • How do I upgrade from OSX 10.7.5 to OSX 10.8.5

    I need to upgrade from OSX 10.7.5 to OSX 10.8.5 in order to use Avid Pro Tools 10 and 11 on the same iMac. My iMac is 2.5GHz Core i5. Pro Tools 10 will not work on OSX 10.9 and Pro Tools 11 needs 10.8.5 or 10.9.4. Not certified for Yosemite.

  • Burning with Other Programs?

    I've continually had burning error 4261 preventing me from making CD's with iTunes. Someone suggested burning from iTunes using another program like Nero. I am totally unfamiliar with doing that. How would that work. I like (or did whenever I was mir

  • My MacBook pro isn't HDCP?

    I tried to Watch Grimm s01e01 that I bought from iTunes and it keeps telling me that it can't play because my monitor isn't HDCP compliant, but I can watch my Season 8 House episodes from itunes in 720 just fine. To be clear, I don't have an external