Extending UIComponent, createChildren question
All,
I'm trying to make some simple components. For the sake of making this exercise very simple, I'm using a callout control from Adobe posted here.
http://www.adobe.com/devnet/flex/samples/fig_callout/
The source of that component can be viewed here:
http://www.adobe.com/devnet/flex/samples/fig_callout/srcview/index.html
More specifically, I'm looking at the src/AirportCallout.mxml file.
I'm looking at making a class that extends UIComponent.
public class AlertWrapper extends UIComponent
private var callout : Callout;
public function AlertWrapper(){
super();
this.buttonMode = true;
//this.addEventListener(MouseEvent.CLICK, alertClicked);
this.graphics.drawCircle(25, 25, 5);
override protected function createChildren():void{
super.createChildren();
this.callout = new Callout();
this.callout.x = 25
this.callout.y = 25;
this.addChild(this.callout);
override protected function measure():void{
super.measure();
This is obviously a very simple example dumbed down for the sake of figuring out what's going on. I'm drawing a circle at point (25, 25) with a radius of 5. I'm then trying to place a callout component (something that adobe made and works well) onto this component as a child.
When I add an instance of the AlertWrapper class to the display list (In the real world situation, I add it to a container using the addChild method), it does not render the callout correctly (it's the wrong size, much smaller than it should be). I'm stumped trying to figure out why this is. If I look at the AirportCallout.mxml class, I see that it isn't given a size by default. If I give it a size of 200, it does render correctly (albeit the wrong size).
Can anyone shed any light of this? I'm new to designing my own controls that extend UIComponent.
Thanks,
Dan
public class AlertWrapper extends UIComponent
private var callout : Callout;
public function AlertWrapper(){
super();
this.buttonMode = true;
//this.addEventListener(MouseEvent.CLICK, alertClicked);
this.graphics.drawCircle(25, 25, 5);
override protected function createChildren():void{
super.createChildren();
this.callout = new Callout();
this.callout.x = 25
this.callout.y = 25;
this.addChild(this.callout);
override protected function measure():void{
super.measure();
this.measuredHeight = this.callout.getExplicitOrMeasuredHeight();
this.measuredWidth = this.callout.getExplicitOrMeasuredWidth();
Doing something like this does not render correctly. It looks cut off like this.
var alertWrapper : AlertWrapper = new AlertWrapper();
var canvas : Canvas = new Canvas();
canvas.addChild(alertWrapper);
When debugging, the alertWrapper measuredHeight and measuredWidth are set to 35 and 32.
It looks like this
If I change the code in alertWrapper and change the createChildren and measure functions to as follows, I can hack my way through it:
override protected function createChildren():void{
super.createChildren();
this.callout = new Callout();
this.callout.x = 25
this.callout.y = 25;
// this.addChild(this.callout);
override protected function measure():void{
super.measure();
// this.measuredHeight = this.callout.getExplicitOrMeasuredHeight();
// this.measuredWidth = this.callout.getExplicitOrMeasuredWidth();
Then, if I add it to my container as such, it renders correctly but I don't understand why. When I debug with this second method, the measuredWidth and measuredHeight of the alertWrapper are both 0 (which is weird since the circle is being drawn).
var alertWrapper : AlertWrapper = new AlertWrapper();
var canvas : Canvas = new Canvas();
canvas.addChild(alertWrapper);
canvas.addChild(alertWrapper.callout);
This second method seems very hacky and I would like to understand what I have to do to make it work so I only have to add the alertWrapper to the container to get it to render correctly. Please help!
Similar Messages
-
within my custom UIComponent when I want to addchildren, should I always be overriding and using the
protected function createChildren ?
I notice I can use addChild anywhere without overriding the protected createChildren function and it still works.
Should I not be doing this ?
ThanksIt depends on what purpose you are trying to addChild().
If you are doing that initially while creating the component only then it's better to use createChildren() function, but id you are tring to add child for displayng some data, say like list components or so, then try to use updateDisplayList() method.
cause, as far as I know, createChildren() method gets called when the component it self is added to display list, that is only single time, and updateDisplayList() gets called whenever th component needs to get updated.
Hope, this should help u -
CS3 Extended copy right question
Hello,
I have a question concerning copy right of Photoshop CS3 Extended software.
Is it legal to sell a version of CS3 Extended on a flashdrive? There is a company that is selling it on a flashdrive and they claim that it doesn't have to be activated but the help files have been removed and the software cannot be undated.
I asked the company about the software and they claimed it is legal. This is what they said;
This is not an illegal copy. The "Patent and Legal Notices" in the "Help" menu clearly state in the (EULA) the following (section:2 paragraph 2):
"Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and associated documentation (the “Data Files”) or Unicode software and associated documentation (the “Software”) to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that (a) the above copyright notice(s) and this permission notice appear in all copies of the Data Files or Software, (b) both the above copyright notice(s) and this permission notice appear in associated documentation, and © there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified".
Please let me know if this is legal.
ThanksThey're giving you a good discount because it can't be updated, right? Not charging you this much:
http://www.officedepot.com/a/products/970410/Adobe-Photoshop-CS3-Extended-complete-package /
Why not read for yourself:
http://www.adobe.com/products/eulas/
http://livedocs.adobe.com/en_US/Photoshop/10.0/ -
Hi gurus.
I have a question about this kind of environment.
In a Extended RAC scenario, with host-based mirroring (active/active storage with ASM) and a third site to mantain the voting disk, What will happen in a communication failure between the two sites (DWDM failure)?
This failure could be a problem? The Oracle RAC will survive?
Thank you!Hi,
In a Extended RAC scenario, with host-based mirroring (active/active storage with ASM) and a third site to mantain the voting disk, What will happen in a communication failure between the two sites (DWDM failure)?
This failure could be a problem? The Oracle RAC will survive?This questions you must not get here ... you must get these answers by testing their environment.
Extended clusters need additional destructive testing, covering:
** Site failure*
** Communication failure*
But..... If DWDM fails the split-brain scenario should happen. You should search about "Oracle RAC Cluster Fencing ( For your specific release)" to understand the symptoms caused by split-brain scenario.
Regards,
Levi Pereira -
The measurement tool in Photoshop CS5 Extended can accurately measure distance, area and angels in your image but did you know that you can customize the scale that you measure? Colin will show you have to use these tools and accurately measure the height of our stand-in criminal Karl Miller. Also covered will be out to print our 1:1 so that measurements can be taken from printed outputs.
http://adobe.ly/yK4Aa9Hi,
Where can I find the Analysis Menu in CS6 ?
I try to print an "ortographic" front view of a 3D model in 1:1 scale but I can't use your trick...
Many Thanks -
Using "bridge mode" to extend a network question
I had been using my TC as my only wireless router. I recently obtained FiOS service and they provided me with a router that is working just fine. That router is in the basement. The house is wired for internet so I connected the TC upstairs thinking I could use it to extend the signal.
I put it in bridge mode but even when I'm in the same room my connecting devices don't show a very strong wireless signal. I'm wondering if I've set it up correctly.
I noticed when I go into the airport utility that wireless mode is turned off. Is this correct for what I'm trying to do?
If I turn on the option to "extend a wireless network) I'm not sure if I'm supposed to enter the name of the network currently assigned to my other router. A password is pre-filled in there it looks like but perhaps that from when I used to the TC by itself.
Under the "internet" tab, I have "connection sharing" set to "off-bridge mode." I think that's correct, yes?
Thanks.Bridge mode is the correct setting for Connection Sharing on your TC, but you need to configure your wireless on the TC to "Create a wireless network" with the exact same name (SSID), security and password that the FIOS router is using. This will, in effect, expand your network. Your laptop will automatically connect to the device with the strongest signal as you move around the house. This is known as a "roaming" network, and it is the basic network design behind most commercial wireless installations.
The "extend a wireless network" setting is only used if you have another Apple "n" router as your main base station and you want to expand the network using wireless only, not ethernet. The "extend" setting would not be compatible with any of the FIOS routers, so you would not be able to use this setting on your network. -
UIComponent validator question
i use flex 3.5 sdk
i have a textinput and have several validations on it, then i want click a button named "Reset" to reset the textinput content and clear the red border
i do like this
textInput.text = "";
textInput.errorString = "";
this is wrong, because in UIComponent.as, add two array errorObjectArray and errorArray to control the validatorResult
so i add a function in UIComponent.as like this
* reset the errorString
public function validationResultReset():void
if (errorObjectArray != null)
errorObjectArray.splice(0, errorObjectArray.length);
errorArray.splice(0, errorArray.length);
errorString = "";
then change call
textInput.text = "";
textInput.validationResultReset();
i feel this is not a good solution, someone give me a suggestion.
Thanks a lotThanks for your reply, Johnny
if use errorString="", the if the validator validate invalid, then it will not show the errorString.
because is 3.5 sdk, have two array errorObjectArray and errorArray to control the validationResult
in UIComponent.as validationResultHandler function it will judge the validator is in the errorObjectArray, if exists and the errorMsg not change it will not set the errorString
so if you do not clear the errorObjectArray and errorArray when you reset, it will not show the errorString again.
what is your sdk version used? -
Cisco RE1000 WiFi extender ethernet port question
Good morning - I have a RE1000 WiFi range extender which is unable to reach the far end of my house, an old barn with a thick stone wall in the middle (& the ADSL line enters at the other end of the building). I have tried various extender locations on both sides of this internal stone wall without consistent success.
A simple solution - IF the ethernet port is two-way - would be to run a 100ft long exterior Cat5 ethernet cable from my existing router to the far end of the house, into the RE1000 as its feed (as opposed to the RE1000 trying to pick up the WiFi signal from the router) & then any WiFi device at that far end of the house could connect via the WiFi signal from the ethernet-powered RE-1000.
Will this work, ie. will the RE1000 accept the ethernet signal as its source and transmit it onwards via its WiFi capabilities (or is the RE1000 ethernet port's only purpose to transmit wirelessly-received signals to a wired, non-WiFi-capable device ?) ?The use of Ethernet port in RE1000:
"> Ethernet (green) Using Ethernet cables (also called network
cables), this Ethernet port connects Ethernet network devices
to your wireless network.
The green light turns on when an Ethernet device is connected
and active on this port. The light flashes when the extender is
sending or receiving data over the Ethernet port.
Source:http://downloads.linksys.com/downloads/userguide/1224698283526/RE2000_UG_3425-01650B_Web.pdf -
Hello,
any suggestions why the following ACL will not apply?
access-list 100 permit udp any host 192.168.155.18 eq domain
access-list 100 permit tcp any host 192.168.155.18 eq domain
access-list 100 permit tcp any host 192.168.155.18 established
access-list 100 deny udp any host 192.168.155.18
access-list 100 deny tcp any host 192.168.155.18
access-list 100 permit ip any any
interface GigabitEthernet0/2.16
description Subnetz 192.168.155.16/28
encapsulation dot1Q 16
ip address 192.168.155.17 255.255.255.240
ip access-group 100 in
The server 192.168.155.18 should only answer on requests on port 53 (tcp and udp). IOS image is c7200-jk9s-mz.124-25c.bin. Applied this access-list I can still connect through any other port like ssh and so on.
Thanks,
ThomasHi Rick,
no there is no NAT or other things turned on on this device.
Router#sh ip access-list 100
Extended IP access list 100
10 permit udp any host 192.168.155.18 eq domain (379 matches)
20 permit tcp any host 192.168.155.18 eq domain (5 matches)
30 permit tcp any host 192.168.155.18 established (1 match)
40 deny udp any host 192.168.155.18 (788 matches)
50 deny tcp any host 192.168.155.18 (79 matches)
60 permit ip any any (562 matches)
Router#sh ip int gi0/2.16
GigabitEthernet0/2.16 is up, line protocol is up
Internet address is 192.168.155.17/28
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is disabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are never sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is enabled
IP Flow switching is enabled
IP CEF switching is enabled
IP Flow switching turbo vector
IP Flow CEF switching turbo vector
IP multicast fast switching is enabled
IP multicast distributed fast switching is disabled
IP route-cache flags are Fast, Flow cache, CEF, Full Flow
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
RTP/IP header compression is disabled
Policy routing is disabled
Network address translation is disabled
BGP Policy Mapping is disabled
WCCP Redirect outbound is disabled
WCCP Redirect inbound is disabled
WCCP Redirect exclude is disabled
Reminder: 192.168.155.18 is fictive IP address because it was changed only for this post here.
Thanks,
Thomas -
Extend JDialog - stupid question
I'm trying to make my own custom JDialog so I did this:
public class myJDialog extends javax.swing.JDialog {
public myJDialog(javax.JFrame parentFrame){
super(parentFrame);
init();
public void init(){
/// add panel and components to this dialog...
}then, in my main frame, I did this:
myJDialog dialog = new JDialog(this);
button_something when actionPerformed {
dialog.setVisible(true);
}new JDialog opens up but it's in native Java look and feel so I figured that I'm doing something wrong.
Couldn't find any tutorials on extending JDialog so I'm asking what am I doing wrong?Athlon1600 wrote:
not at all. I don't want to change JDialog component in any way. I'm doing this just to make code cleaner and easier to work with.
how would I call Xdialog if I'm not extending it? How would Java know that that variable is holding jDialog component?The JDialog is the least part of the code. Myself I usually have a class that creates a JPanel (note that it doesn't extend a JPanel). Then in the code that needs a dialog, I instantiate the class, extract the JPanel create a simple JDialog, and place the JPanel into the JDialog. Simple as that. -
R8.2 Extended Schema Tables Question
Can someone explain the difference between the extended schema’s tables with the same name, but different suffixies? For example: NAME, NAME_FULL, NAME_S and NAME_U. They seemingly have the same columns and data (rows).
I took some time today to look at the selects of the views. Here are some of my initial findings:
NAME - The select on the production tables, lots of column aliases to make the naming more intuitive. Filters out deleted sessions. The ETL, if you will.
NAME_FULL - This is simply a view of the above view with no new aliases or where statement. Basically SELECT * FROM NAME. This is presumably the view they want you to hit.
NAME_U - I assume the U stands for User. It basically does an INNER JOIN from the data (NAME view) you need to the PROJECTSECURITY, RESOURCESECURITY, GLOBALSECURITY, etc table(s) to limit the data. But not all of these views look at the security views/tables, therefore, you get the same data as the original view. No WHERE statement on these - the INNER JOIN effectively does it for you.
NAME_S (NOT MANY VIEWS INCL THIS ONE) - I assume the S stands for Secure Code, although one DBA mistakenly wrote out SECURITY instead of S on the pxrptuser.RESOURCE view. This view uses an inner joins to look at the object userIDs, secure code flags, etc.
This is what I needed for an immediate assignment, but I will be digging into these more and will edit this and/or post a better white paper on my web site. -
Extending View Object Question
When I extend a View Object in iSupplier Portal, and set project Substitutions.
Does it mean that all pages that use this VO would be substitute by new VO?
If the above answer is Yes.
Is there any way to substitute VO only for one page?
Also where can I find which pages use this VO, or I can only looking
page by page to know who have used the VO that I intended to substitute ?
Thanks a lot.When I extend a View Object in iSupplier Portal, and set project Substitutions.
Does it mean that all pages that use this VO would be substitute by new VO?
--Yes all the pages that use this VO would be substituted by new VO.
If the above answer is Yes.
Is there any way to substitute VO only for one page?
-- No
Also where can I find which pages use this VO, or I can only looking
page by page to know who have used the VO that I intended to substitute ?
-- You need to check the page by page the usage of the VO.
ANoop -
Another 'can this wirelessly extend my network' question, but with a twist
Perhaps not a great twist, but I'm running a powerline network in my home, from an Apple Extreme-N Airport. Love the speed, but am wondering if I can simply plug an Airport Express on the far end of the house into the powerline system and use it to broadcast the signal where it's a bit weak.
Is this possible? It sure seems so. I much appreciate the helpWelcome to the discussion area, applenewbie80!
but am wondering if I can simply plug an Airport Express on the far end of the house into the powerline system and use it to broadcast the signal where it's a bit weak.
Yes, you can do this if you configure the AirPort Express as a "bridge" to create a wireless network using the same wireless network name, security and password as your AirPort Extreme network.
Then, computers will be able to "roam" from one area to another and stay on the same network. Or, you could assign a different name and log in for the AirPort Express wireless if you preferred.
Post back if you need more information. -
Generic BST that Extends Comparable, Method question.
private Node removeFromTreeHelper( T value, Node curr )
if( curr == null ) // If curr is null, then the
{ ok = false;
return null; // VALUE is not in the tree
else if( value.compareTo(curr.item) < 0 ) // Try the left subtree right if <
curr.left = removeFromTreeHelper( value, curr.left );
else if( value.compareTo(curr.item) > 0 ) // Try the right subtree right if >
curr.right = removeFromTreeHelper( value, curr.right);
else // We have found the value to be removed.
// Does it have two descendants, or only one, or is it a leaf?
if( curr.left != null && curr.right != null )
// Two descendants. Move the smallest value greater than value
// up and delete the node that contianed it recursively.
curr.item = findMin( curr.right).item;
curr.right = removeFromTreeHelper( curr.item, curr.right );
else // Only one descendant. Move it up. This also works if a leaf.
if( curr.left != null )
curr = curr.left;
else
curr = curr.right;
ok = true;
return curr;
}This part is killing me. How can this be done with < T > (Generic).
// Two descendants. Move the smallest value greater than value
// up and delete the node that contianed it recursively.
curr.item = findMin( curr.right).item;
curr.right = removeFromTreeHelper( curr.item, curr.right );
}I need to pass T value not curr.item, is there a work around here?
Message was edited by:
venture
Message was edited by:
ventureIs this even possible or would it be best to go ahead and make a whole new method for removal? 3 hours of staring at this code and Im right back where I started.
-
Extended hardware test question
i am running a hardware test on my macbookpro and the test says that "Estimated time to complete: 1 hour or longer , depending on the amount of memory installed." it says "Test" in the bar with no more progress bar shown and under "Test Results" it says "no trouble found" and "Pass Number: 3, Total Time Testing 2 hours 22 mins 16 secs".
the fan started blowing loud and hard when i started the test (unlike the mac pro test) and i am just wondering if this sounds right.
the fan blew loud and hard through the whole test. loud and hard enough to be concerned about it.
is this all normal? normal for a certain MBP model, all MBP's?
thanksIf there is an update to your particular graphics firmware, Software Update will let you know; if there is nothing showing there, it means there is no update available for your configuration. Do not simply download from the Apple website and install something that could cause havoc on your machine.
I'm not sure what the problem might be, but it could be graphics card and/or logic board related. Since you've already done the SMC and PRAM resets, unless someone else has another idea, I'd suggest booking an appointment at your nearest Genius Bar for a free evaluation and diagnosis. If the problem is intermittent, take screen shots or video of it so you can show it to them.
Maybe you are looking for
-
Delivery document available in VKDFS table. How to remove that?
Hi, The scenario goes like this. I create purchase order,goods receipt and invoice. followed by which i create a return delivery for one line item . Now this return delivery gets added in VKDFS table. The reason is because billingtype is IV(Intercomp
-
Portal Runtime Error : An exception occurred while processing a request
Hello friends, After upgradation of my portal to the following patch level, SAP J2EE 6.20: <b>Portal Version :</b> EP 6 SP 2 patch 29 hotfix 0 <b>Content Mgmt and Collaboration version</b> : 6 SP2 patch 5 i faced many performance related issues. Por
-
Code the "Edit Locally" KM functionnality
Hello experts, Is it possible to reproduce in Webdynpro 4 java the behaviour of the "Edit Locally" functionnality ? or maybe in other technologies ? (jsp, ...) By example, in my View I'd like to create a Check Out button, that automatically loads loc
-
"Java Script Disabled on your browser. Please Enable it."
I tried to log-in to this site: "http://www.edudel.nic.in/mis/MisAdmin/frmMisLogin.aspx" but instead got this message: "Java Script Disabled on your browser. Please Enable it." I have already enabled JavaScript in settings, but it gives the same erro
-
Search Encrypt Methods Of Spatial Data !!!
Hi: Hello,Everybody! I trying to search encrypt methods of spatial data(vector data),whether some also made a study of this aspect ,Can anyone guide to me ? Li in China