本文整理汇总了Java中org.lwjgl.Sys.openURL方法的典型用法代码示例。如果您正苦于以下问题:Java Sys.openURL方法的具体用法?Java Sys.openURL怎么用?Java Sys.openURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.Sys
的用法示例。
在下文中一共展示了Sys.openURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import org.lwjgl.Sys; //导入方法依赖的package包/类
protected void actionPerformed(GuiButton guibutton)
{
if(!guibutton.enabled)
{
return;
}
if(guibutton.id == 5)
{
Sys.openURL((new StringBuilder()).append("file://").append(fileLocation).toString());
} else
if(guibutton.id == 6)
{
mc.displayGuiScreen(guiScreen);
} else
{
guiTexturePackSlot.actionPerformed(guibutton);
}
}
示例2: actionPerformed
import org.lwjgl.Sys; //导入方法依赖的package包/类
@Override
protected void actionPerformed(GuiButton btn)
{
if(invoker.getId(btn) == 69){
this.mc.displayGuiScreen(GuiResilienceMain.screen);
hasClickedRes = true;
}else if(invoker.getId(btn) == 70){
Sys.openURL("http://resilience.krispdev.com/suggest");
}else if(invoker.getId(btn) == 199){
btn.displayString = "Change to "+version;
if(version.equals("1.7.9")){
version = "1.7.6";
Resilience.getInstance().getValues().version = 4;
}else if(version.equals("1.7.6")){
version = "1.7.9";
Resilience.getInstance().getValues().version = 5;
}
}//else if(invoker.getId(btn) == 124124){
//this.func_140005_i();
//}
super.actionPerformed(btn);
}
示例3: testUrl
import org.lwjgl.Sys; //导入方法依赖的package包/类
/**
* Tests the openUrl
*/
private void testUrl() {
System.out.println("==== Test URL ====");
System.out.println("Opening a browser window to http://www.lwjgl.org");
Sys.openURL("http://www.lwjgl.org");
System.out.println("---- Test URL ----\n");
}
示例4: actionPerformed
import org.lwjgl.Sys; //导入方法依赖的package包/类
@Override
public void actionPerformed(GuiButton btn){
if(invoker.getId(btn) == 0){
Sys.openURL("http://resilience.krispdev.com/donate");
invoker.displayScreen(parent);
}else if(invoker.getId(btn) == 1){
invoker.displayScreen(parent);
}
}
示例5: actionPerformed
import org.lwjgl.Sys; //导入方法依赖的package包/类
@Override
public void actionPerformed(GuiButton btn){
if(btn.id == 0){
mc.displayGuiScreen(parent);
}else{
Sys.openURL("http://resilience.krispdev.com/donate");
}
}
示例6: mouseClicked
import org.lwjgl.Sys; //导入方法依赖的package包/类
@Override
public void mouseClicked(int x, int y, int btn){
for(Object[] o : links){
Rectangle r = (Rectangle) o[0];
if(x >= r.getX() && x <= r.getMaxX() && y >= r.getY() && y <= r.getMaxY()){
Sys.openURL((String)o[1]);
break;
}
}
super.mouseClicked(x, y, btn);
}
示例7: actionPerformed
import org.lwjgl.Sys; //导入方法依赖的package包/类
@Override
public void actionPerformed(GuiButton btn){
if(invoker.getId(btn) == 0){
invoker.displayScreen(parent);
}else if(invoker.getId(btn) == 1){
Sys.openURL("http://resilience.krispdev.com/donate");
invoker.displayScreen(parent);
Resilience.getInstance().getFileManager().saveOptions("0");
}else{
Resilience.getInstance().getFileManager().saveOptions("-1");
invoker.displayScreen(parent);
}
}
示例8: openFile
import org.lwjgl.Sys; //导入方法依赖的package包/类
public static void openFile(String path)
{
File file = new File(path);
String apath = file.getAbsolutePath();
try
{
Desktop.getDesktop().open(file);
}catch(IOException e)
{
logger.error("Failed to open file via Desktop.", e);
}
if(Util.getOSType() == Util.EnumOS.WINDOWS)
{
String command = String.format(
"cmd.exe /C start \"Open file\" \"%s\"", new Object[]{apath});
try
{
Runtime.getRuntime().exec(command);
return;
}catch(IOException var8)
{
logger.error("Failed to open file", var8);
}
}else if(Util.getOSType() == Util.EnumOS.OSX)
try
{
logger.info(apath);
Runtime.getRuntime().exec(new String[]{"/usr/bin/open", apath});
return;
}catch(IOException var9)
{
logger.error("Failed to open file", var9);
}
boolean browserFailed = false;
try
{
Desktop.getDesktop().browse(file.toURI());
}catch(Throwable var7)
{
logger.error("Failed to open file", var7);
browserFailed = true;
}
if(browserFailed)
{
logger.info("Opening via system class!");
Sys.openURL("file://" + apath);
}
}
示例9: openFile
import org.lwjgl.Sys; //导入方法依赖的package包/类
public static void openFile(File fileIn)
{
String s = fileIn.getAbsolutePath();
if (Util.getOSType() == Util.EnumOS.OSX)
{
try
{
LOGGER.info(s);
Runtime.getRuntime().exec(new String[] {"/usr/bin/open", s});
return;
}
catch (IOException ioexception11)
{
LOGGER.error((String)"Couldn\'t open file", (Throwable)ioexception11);
}
}
else if (Util.getOSType() == Util.EnumOS.WINDOWS)
{
String s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {s});
try
{
Runtime.getRuntime().exec(s1);
return;
}
catch (IOException ioexception1)
{
LOGGER.error((String)"Couldn\'t open file", (Throwable)ioexception1);
}
}
boolean flag = false;
try
{
Class<?> oclass = Class.forName("java.awt.Desktop");
Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {fileIn.toURI()});
}
catch (Throwable throwable)
{
LOGGER.error("Couldn\'t open link", throwable);
flag = true;
}
if (flag)
{
LOGGER.info("Opening via system class!");
Sys.openURL("file://" + s);
}
}
示例10: openFile
import org.lwjgl.Sys; //导入方法依赖的package包/类
public static void openFile(File fileIn)
{
String s = fileIn.getAbsolutePath();
if (Util.getOSType() == Util.EnumOS.OSX)
{
try
{
LOGGER.info(s);
Runtime.getRuntime().exec(new String[] {"/usr/bin/open", s});
return;
}
catch (IOException ioexception1)
{
LOGGER.error((String)"Couldn\'t open file", (Throwable)ioexception1);
}
}
else if (Util.getOSType() == Util.EnumOS.WINDOWS)
{
String s1 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {s});
try
{
Runtime.getRuntime().exec(s1);
return;
}
catch (IOException ioexception)
{
LOGGER.error((String)"Couldn\'t open file", (Throwable)ioexception);
}
}
boolean flag = false;
try
{
Class<?> oclass = Class.forName("java.awt.Desktop");
Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {fileIn.toURI()});
}
catch (Throwable throwable)
{
LOGGER.error("Couldn\'t open link", throwable);
flag = true;
}
if (flag)
{
LOGGER.info("Opening via system class!");
Sys.openURL("file://" + s);
}
}
示例11: openFile
import org.lwjgl.Sys; //导入方法依赖的package包/类
public static void openFile(String path) {
File file = new File(path);
String apath = file.getAbsolutePath();
try {
Desktop.getDesktop().open(file);
} catch (IOException e) {
logger.error("Failed to open file via Desktop.", e);
}
if (Util.getOSType() == Util.EnumOS.WINDOWS) {
String command = String.format("cmd.exe /C start \"Open file\" \"%s\"", apath);
try {
Runtime.getRuntime().exec(command);
return;
} catch (IOException var8) {
logger.error("Failed to open file", var8);
}
} else if (Util.getOSType() == Util.EnumOS.OSX) {
try {
logger.info(apath);
Runtime.getRuntime().exec(new String[]{"/usr/bin/open", apath});
return;
} catch (IOException var9) {
logger.error("Failed to open file", var9);
}
}
boolean browserFailed = false;
try {
Desktop.getDesktop().browse(file.toURI());
} catch (Throwable var7) {
logger.error("Failed to open file", var7);
browserFailed = true;
}
if (browserFailed) {
logger.info("Opening via system class!");
Sys.openURL("file://" + apath);
}
}
示例12: failedOpenGL
import org.lwjgl.Sys; //导入方法依赖的package包/类
private final static void failedOpenGL(LWJGLException e) {
e.printStackTrace();
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch(Exception je) {
je.printStackTrace();
}
ResourceBundle bundle = ResourceBundle.getBundle(Renderer.class.getName());
String title = Utils.getBundleString(bundle, "error_title");
String message = Utils.getBundleString(bundle, "opengl_error_message");
int choice = JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if (choice == JOptionPane.YES_OPTION) {
String new_uid = (new UID()).toString();
String uid = readOrSetPreference("uid", new_uid);
String os_name = System.getProperty("os.name");
String os_arch = System.getProperty("os.arch");
String os_version = System.getProperty("os.version");
String java_version = System.getProperty("java.version");
String java_vendor = System.getProperty("java.vendor");
long total_mem = Runtime.getRuntime().maxMemory();
String adapter_name = Display.getAdapter();
String adapter_version = Display.getVersion();
try {
String url = "http://oddlabs.com/driversupport.php?"
+ "uid=" + URLEncoder.encode(uid, "UTF-8")
+ "&raw_os=" + URLEncoder.encode(os_name, "UTF-8")
+ "&os_version=" + URLEncoder.encode(os_version, "UTF-8")
+ "&arch=" + URLEncoder.encode(os_arch, "UTF-8")
+ "&java_version=" + URLEncoder.encode(java_version, "UTF-8")
+ "&java_vendor=" + URLEncoder.encode(java_vendor, "UTF-8")
+ "&total_mem=" + URLEncoder.encode("" + total_mem, "UTF-8");
if (adapter_name != null)
url += "&adapter_name=" + URLEncoder.encode(adapter_name, "UTF-8");
if (adapter_version != null)
url += "&adapter_version=" + URLEncoder.encode(adapter_version, "UTF-8");
Sys.openURL(url);
} catch (java.io.UnsupportedEncodingException uee) {
uee.printStackTrace();
}
}
Main.shutdown();
}
示例13: mouseClicked
import org.lwjgl.Sys; //导入方法依赖的package包/类
public final void mouseClicked(int button, int x, int y, int clicks) {
Renderer.shutdown();
Sys.openURL(Settings.getSettings().buy_url);
}
示例14: openURI
import org.lwjgl.Sys; //导入方法依赖的package包/类
@Override
public void openURI (String URI) {
Sys.openURL(URI);
}
示例15: func_73875_a
import org.lwjgl.Sys; //导入方法依赖的package包/类
protected void func_73875_a(GuiButton p_73875_1_) {
if(p_73875_1_.field_73742_g) {
if(p_73875_1_.field_73741_f == 5) {
File var2 = GuiScreenTemporaryResourcePackSelectSelectionList.func_110510_a(this.field_110346_c).func_110612_e();
String var3 = var2.getAbsolutePath();
if(Util.func_110647_a() == EnumOS.MACOS) {
try {
this.field_73882_e.func_98033_al().func_98233_a(var3);
Runtime.getRuntime().exec(new String[]{"/usr/bin/open", var3});
return;
} catch (IOException var9) {
var9.printStackTrace();
}
} else if(Util.func_110647_a() == EnumOS.WINDOWS) {
String var4 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[]{var3});
try {
Runtime.getRuntime().exec(var4);
return;
} catch (IOException var8) {
var8.printStackTrace();
}
}
boolean var10 = false;
try {
Class var5 = Class.forName("java.awt.Desktop");
Object var6 = var5.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
var5.getMethod("browse", new Class[]{URI.class}).invoke(var6, new Object[]{var2.toURI()});
} catch (Throwable var7) {
var7.printStackTrace();
var10 = true;
}
if(var10) {
this.field_73882_e.func_98033_al().func_98233_a("Opening via system class!");
Sys.openURL("file://" + var3);
}
} else if(p_73875_1_.field_73741_f == 6) {
this.field_73882_e.func_71373_a(this.field_110347_a);
} else {
this.field_110346_c.func_77219_a(p_73875_1_);
}
}
}